[Haskell-cafe] simple state monad exercises? (besides labeling trees)

Thomas ten Cate ttencate at gmail.com
Mon Jul 6 13:17:28 EDT 2009

I used the State monad to implement a Brainfuck [1] interpreter a few
months ago. It stored the program counter, pointer and the memory of
the machine.

There might have been a different (better?) way, but as I was trying
to learn more about monads, it was an obvious choice.


[1] http://www.muppetlabs.com/~breadbox/bf/

On Mon, Jul 6, 2009 at 18:54, Thomas Hartman<tphyahoo at gmail.com> wrote:
> Can someone give some simple common scenarios where the state monad is
> useful, besides labeling trees?
> References to puzzles like those in project Euler or similar would be nice.
> Thanks!
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

More information about the Haskell-Cafe mailing list