This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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 |