Created
December 15, 2014 22:33
-
-
Save mrmurphy/663cb3f2fbd2b08f4a8d to your computer and use it in GitHub Desktop.
This file contains 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
{-# LANGUAGE OverloadedStrings #-} | |
import Control.Monad.State | |
import System.Posix.Unistd | |
makeStateBetter :: StateT Int IO () | |
makeStateBetter = do | |
curState <- get | |
put (curState + 1) | |
pogamMonad :: StateT Int IO () | |
pogamMonad = do | |
makeStateBetter | |
cake <- get | |
lift (print cake) | |
lift (sleep 1) | |
pogamMonad | |
mainGuts :: Int -> IO () | |
mainGuts n = do | |
execStateT pogamMonad n | |
return () | |
main :: IO () | |
main = mainGuts 4900 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment