<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">I hadn't seen that before, thanks.&nbsp; My code wouldn't be that useful as it depends on some of my datatypes.&nbsp; I don't know some basic things here since I'm so new to Haskell.&nbsp; For example, am I to assume that I need to create my own instance of State and then define get and put for it?&nbsp; Some of the examples seem to just use functions that manipulate a state but do not create a new datatype.<br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Arie Peterson &lt;ariep@xs4all.nl&gt;<br>To: haskell-cafe@haskell.org<br>Sent: Monday, July 2, 2007 2:46:14 PM<br>Subject: Re: [Haskell-cafe] Very simple parser<br><br><div><br><br>Did you look at the
 documentation for the State monad?<br>&lt;<a target="_blank" href="http://haskell.org/ghc/docs/latest/html/libraries/mtl/Control-Monad-State-Lazy.html">http://haskell.org/ghc/docs/latest/html/libraries/mtl/Control-Monad-State-Lazy.html</a>&gt;<br>It also contains some examples.<br><br>Getting the next instruction sounds like a job for 'get'; to remove it<br>from the state you might use 'put' or 'modify'.<br><br>If this doesn't help, can you show something you tried?<br><br><br>Greetings,<br><br>Arie<br><br>_______________________________________________<br>Haskell-Cafe mailing list<br>Haskell-Cafe@haskell.org<br><a target="_blank" href="http://www.haskell.org/mailman/listinfo/haskell-cafe">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br></div></div><br></div></div><br>
      <hr size=1>Take the Internet to Go: Yahoo!Go puts the <a href="http://us.rd.yahoo.com/evt=48253/*http://mobile.yahoo.com/go?refer=1GNXIC">Internet in your pocket:</a> mail, news, photos & more. </body></html>