Skip to content

Instantly share code, notes, and snippets.

Avatar

Twan van Laarhoven twanvl

View GitHub Profile
@twanvl
twanvl / gist:3873221
Created Oct 11, 2012
MonadTrans with explicit dictionaries
View gist:3873221
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE ConstraintKinds, GADTs #-}
{-# LANGUAGE FlexibleContexts #-}
import GHC.Exts
-- see http://www.reddit.com/r/haskell/comments/117r1p/whats_wrong_with_ghc_haskells_current_constraint/
data Dict :: Constraint -> * where
Dict :: c => Dict c
@twanvl
twanvl / gist:2938456
Created Jun 15, 2012
Applicative Concurrent computation without unnecessary threads
View gist:2938456
{-# LANGUAGE ImplicitParams #-}
import Control.Monad
import Control.Monad.Fix
import Control.Applicative
import Control.Concurrent
import Control.Concurrent.MVar
import Control.Exception
import Prelude hiding (catch)
import Data.IORef
import Data.Traversable
You can’t perform that action at this time.