
Hello all, I am Vinay Emani, new to this forum. I am doing an academic project of writing an assembler cum linker in Haskell as part of building a compiler set written entirely in Haskell. Since i am new to the language, i thought it would do me good to look at some of the existing haskell code, be it in whatever project and written for whatever purpose. This should help me get started. In particular i need to find some project/program which extensively uses the State Monad. I tried looking at some of the existing open source projects at sourceforge. There are only limited number of projects there, some of them being incomplete. Could you please suggest me some project, from which i can learn the State Monad. Thanks very much Vinay Emani India -- View this message in context: http://www.nabble.com/Haskell-and-State-Monad.-tf4427176.html#a12629170 Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

dav.vire+haskell:
On 9/12/07, VinyleEm
wrote: projects there, some of them being incomplete. Could you please suggest me some project, from which i can learn the State Monad.
xmonad perhaps ?
Yes, I think xmonad is a good example of the standard Haskell approach to server/long running/interactive software in the language. A skin of code runs in either: newtype M = M (StateT State IO) a or newtype M = M (ReaderT Config (StateT State IO)) a deriving (Functor, Monad, MonadState) Is the basic environment these interactive programs run in. -- Don

VinyleEm wrote:
Hello all, I am Vinay Emani, new to this forum. I am doing an academic project of writing an assembler cum linker in Haskell as part of building a compiler set written entirely in Haskell. Since i am new to the language, i thought it would do me good to look at some of the existing haskell code, be it in whatever project and written for whatever purpose. This should help me get started. In particular i need to find some project/program which extensively uses the State Monad. I tried looking at some of the existing open source projects at sourceforge. There are only limited number of projects there, some of them being incomplete. Could you please suggest me some project, from which i can learn the State Monad.
Lambdabot (which is an IRC bot) uses a custom Monad which, IIRC, contains State. It's quite a substantial program and not one you can understand in a single glance, but it could be useful to you to learn from. http://www.cse.unsw.edu.au/~dons/lambdabot.html Jules

VinyleEm wrote:
In particular i need to find some project/program which extensively uses the State Monad.
Perhaps you could tell us why you think you need the State Monad? It may be that there are easier ways of dealing with this. For an assembler you need to build up a symbol table based on symbols found during parsing. If you are using Parsec then the GenParser type (if I recall correctly) has a state parameter for doing exactly this. You will probably find this easier to work with than having separate State and Parser monads. Paul.
participants (5)
-
david48
-
Don Stewart
-
Jules Bean
-
Paul Johnson
-
VinyleEm