I hadn't seen that before, thanks. My code wouldn't be that useful as it depends on some of my datatypes. I don't know some basic things here since I'm so new to Haskell. For example, am I to assume that I need to create my own instance of State and then define get and put for it? Some of the examples seem to just use functions that manipulate a state but do not create a new datatype.
----- Original Message ----
From: Arie Peterson
To: haskell-cafe@haskell.org
Sent: Monday, July 2, 2007 2:46:14 PM
Subject: Re: [Haskell-cafe] Very simple parser
Did you look at the documentation for the State monad?
http://haskell.org/ghc/docs/latest/html/libraries/mtl/Control-Monad-State-La...
It also contains some examples.
Getting the next instruction sounds like a job for 'get'; to remove it
from the state you might use 'put' or 'modify'.
If this doesn't help, can you show something you tried?
Greetings,
Arie
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
____________________________________________________________________________________
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more.
http://mobile.yahoo.com/go?refer=1GNXIC