[Haskell-cafe] Haskell and State Monad.

Don Stewart dons at galois.com
Wed Sep 12 16:54:49 EDT 2007

> On 9/12/07, VinyleEm <vinay.emani at yahoo.co.in> 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
        newtype M = M (ReaderT Config 
                          (StateT State 
                                IO)) a

            deriving (Functor, Monad, MonadState)

Is the basic environment these interactive programs run in.

-- Don

More information about the Haskell-Cafe mailing list