[Haskell-cafe] Very simple parser
gregorypropf at yahoo.com
Mon Jul 2 18:37:52 EDT 2007
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 <ariep at xs4all.nl>
To: haskell-cafe at 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?
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?
Haskell-Cafe mailing list
Haskell-Cafe at haskell.org
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe