Skip to content

Instantly share code, notes, and snippets.

View luciferous's full-sized avatar
🏠
Working from home

Neuman Vong luciferous

🏠
Working from home
View GitHub Profile
@sjoerdvisscher
sjoerdvisscher / zipfree.hs
Created July 19, 2011 23:14
The Resumption monad is just the free monad.
-- The Resumption monad from [1] is just the free monad.
-- [1] http://tomasp.net/blog/comprefun.aspx
import Control.Monad.Free -- From http://hackage.haskell.org/package/free
import Control.Monad.Trans
import Control.Applicative
printLoop :: String -> Int -> a -> Free IO a
printLoop str count result = do
lift $ putStrLn str