Skip to content

Instantly share code, notes, and snippets.

@DeTeam
Created January 18, 2014 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DeTeam/8493059 to your computer and use it in GitHub Desktop.
Save DeTeam/8493059 to your computer and use it in GitHub Desktop.
module Main where
import Control.Monad.State.Lazy
import Control.Applicative ((<$>), (<*>))
myInc = state (\n -> (n, n * n))
myState = (,) <$> myInc <*> myInc
main = print $ computeState
where computeState = evalState myState 10
@DeTeam
Copy link
Author

DeTeam commented Jan 18, 2014

What's the output? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment