<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>As a programming exercise I'm trying to use the State monad to create a simple parser. It's for a very simple assembly language for a simple virtual machine. The state is a string of instructions. I want to be able to call something like getNextInstruction to pull out the next instruction and then update the state (string). I know I can do this non-monadically by just passing the string explicitly each time but I'd like to learn more about the State monad. I also know about Parsec and Happy and so forth but this is just an exercise so I want to do it this way. Any ideas? I can't seem to get anything to work. I've tried different things but I suspect I'm just missing something basic. Can someone post a simple prototype for this? Just assume the
instructions are integers.<br></div></div><br>
<hr size=1><a href="http://us.rd.yahoo.com/evt=48250/*http://searchmarketing.yahoo.com/arp/sponsoredsearch_v9.php?o=US2226&cmp=Yahoo&ctv=AprNI&s=Y&s2=EM&b=50">Pinpoint customers </a>who are looking for what you sell.
</body></html>