Skip to content

Instantly share code, notes, and snippets.

Dan Burton DanBurton

Block or report user

Report or block DanBurton

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View try-ghc-8.8.1-rc1.sh
VERSION=8.8.1-rc1
cd /tmp
mkdir ghc-test && cd ghc-test
wget https://raw.githubusercontent.com/DanBurton/stack-setup-info-gen/master/output/stack-ghc-$VERSION.yaml
mv stack-ghc-$VERSION.yaml stack.yaml
stack setup
stack repl
View try-ghc-8.8.1-alpha2.sh
VERSION=8.8.1-alpha2
cd /tmp
mkdir ghc-test && cd ghc-test
wget https://raw.githubusercontent.com/DanBurton/stack-setup-info-gen/master/output/stack-ghc-$VERSION.yaml
mv stack-ghc-$VERSION.yaml stack.yaml
stack setup
stack repl
View keybase.md

Keybase proof

I hereby claim:

  • I am danburton on github.
  • I am danburton (https://keybase.io/danburton) on keybase.
  • I have a public key ASDWfyHJVknV_V0NtnjEH6bguSeVgQl9e7cEZuH2YLFOWQo

To claim this, I am signing this object:

View try-ghc-8.8.1-alpha1.sh
cd /tmp
mkdir ghc-test && cd ghc-test
wget https://raw.githubusercontent.com/DanBurton/stack-setup-info-gen/master/output/stack-ghc-8.8.1-alpha1.yaml
mv stack-ghc-8.8.1-alpha1.yaml stack.yaml
stack setup
stack repl
@DanBurton
DanBurton / haskell-packages-extendo.nix
Last active Mar 9, 2019
Convenience of "extend", implemented with "override"
View haskell-packages-extendo.nix
self: super:
let
r = rec {
# addExtendo : haskellPackages -> extension
addExtendo = newHp: _: _: {
extendo = hpExtendo newHp;
};
# hpExtendo : haskellPackages -> extension -> haskellPackages
# performs the extension, and also performs the addExtendo extension afterwards.
hpExtendo = hp: extension:
@DanBurton
DanBurton / FromIntegralMay.hs
Created Feb 27, 2019
Safe integral coercions via bounds checking
View FromIntegralMay.hs
{-# LANGUAGE ScopedTypeVariables, TypeApplications #-}
import Data.Int (Int32, Int64)
fromIntegralMay :: forall b a. (Bounded b, Integral a, Integral b) => a -> Maybe b
fromIntegralMay a | a > fromIntegral (maxBound @b) || a < fromIntegral (minBound @b) = Nothing
fromIntegralMay a = Just (fromIntegral a)
justMin = fromIntegralMay @Int32 (-2147483648 :: Int64)
justMax = fromIntegralMay @Int32 (2147483647 :: Int64)
View serve.rkt
#lang typed/racket
(require (for-syntax syntax/parse))
(require typed/net/url)
(require racket/control)
(require/typed xml
[xexpr->string (Xexpr -> String)])
@DanBurton
DanBurton / stack.yaml
Last active Sep 24, 2018
stack.yaml with "setup-info" for ghc-8.6.1-beta1 (aka ghc-8.6.0.20180810)
View stack.yaml
# Generated from https://gist.github.com/DanBurton/5b7fc5fae1ebfdc5bcaecfbac15d2903
setup-info:
ghc:
windows32:
8.6.0.20180810:
url: https://downloads.haskell.org/~ghc/8.6.1-beta1/ghc-8.6.0.20180810-i386-unknown-mingw32.tar.xz
sha256: 9be35662d510d3489ddd583e7d9d38ee6b6ba40b852f6e90e0dfd97a0d7bbfd3
linux32-nopie:
8.6.0.20180810:
@DanBurton
DanBurton / setup-info-gen.hs
Last active Aug 21, 2018
Generate a stack.yaml that can install ghc-8.6.1-beta1 (aka ghc-8.6.0.20180810)
View setup-info-gen.hs
#!/usr/bin/env stack
{- stack
script
--resolver lts-11.16
--package bytestring
--package http-conduit
-}
-- usage: ./Main.hs
-- modify the baseUrl and ghcDateVersion to taste
@DanBurton
DanBurton / curator-removalizer.hs
Created Mar 17, 2018
Parses stackage-curator output (on stderr, saved in "scheck.txt") and transforms this into package removals for build-constraints.yaml (printed to "removalizer.txt")
View curator-removalizer.hs
#!/usr/bin/env stack
{- stack
script
--resolver lts-10.2
-}
module Main where
import qualified Data.Char as Char
import Data.Semigroup ((<>))
You can’t perform that action at this time.