Erik Hesselink hesselink

View hackage-manual-haddocks-upload.py
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/env python2
 
"""
Uploads haddocks to Hackage.
Use it when Hackage can't build your documentation (e.g. missing libraries).
Inspired by:
http://fuuzetsu.co.uk/blog/posts/2014-01-06-Fix-your-Hackage-documentation.html
"""
 
import getpass
View gist:3769836
1 2 3 4 5 6 7 8 9 10
{-# LANGUAGE TypeFamilies, FlexibleInstances #-}
import Control.Monad.Error
import Control.Monad.Reader
 
type family MappedMonad (m :: * -> *) e' :: * -> *
type instance MappedMonad (ErrorT e m) e' = ErrorT e' m
type instance MappedMonad (ReaderT r m) e' = ReaderT r (MappedMonad m e')
 
class MapError m where
type ErrorType m :: *
View gist:3757658
1 2 3 4 5 6 7 8 9 10
{-# LANGUAGE Rank2Types #-}
 
import Control.Applicative
import Control.Arrow
import Control.Monad
import Control.Monad.Trans.Maybe
import Control.Monad.Trans.Reader
import Control.Monad.Trans.State
import Control.Monad.Trans.Writer
import Data.Monoid
View ExtensibleRecords.hs
1 2 3 4 5 6 7 8 9 10
{-# LANGUAGE
GADTs
, KindSignatures
, DataKinds
, PolyKinds
, TypeOperators
, TypeFamilies
, MultiParamTypeClasses
, FlexibleInstances
, UndecidableInstances
View gist:775990
1 2 3 4 5 6 7 8 9 10
{-# LANGUAGE GADTs, KindSignatures #-}
 
import Prelude hiding (length, sum)
 
import Control.Applicative
import Control.Arrow
 
newtype Fix f = In { out :: f (Fix f) }
 
data Alg :: (* -> *) -> * -> * -> * where
View gist:704109
1 2 3 4 5 6 7 8 9 10
{-# LANGUAGE EmptyDataDecls
, TypeFamilies
, MultiParamTypeClasses
, FlexibleContexts
, FlexibleInstances
, UndecidableInstances
, ScopedTypeVariables
#-}
 
import Control.Applicative
View gist:306525
1 2 3 4 5 6 7 8
function f (x)
{
var y = x;
Array.prototype.shift.call(arguments);
return x + y;
}
 
f(1, 2); // Returns 3, not 2.
Something went wrong with that request. Please try again.