Combining IO and state monads

Mark Carroll mark@chaos.x-philes.com
Mon, 19 May 2003 10:02:06 -0400 (EDT)


On Sat, 17 May 2003, Derek Elkins wrote:

> On Thu, 15 May 2003 21:07:47 +0100
> Graham Klyne <GK@ninebynine.org> wrote:
>
> > It appears that what I want in the near term is to apply "StateT" to
> > "IO".  Hopefully, working with that will help to develop my intuitions
> > for the more general cases.  (It would help if the GHC libraries were
> > more documented, but I guess we can't expect everything on a plate
> > just yet.)
>
> See MonadTemplateLibrary on HaWiki, there is documentation of many of
> the Monad* classes.  While the transformers aren't explicitly
> documented, they are all instances of their respective Monad* class.
(snip)

Yes, and mixing StateT with IO has an explicit example at the end of 1.4
at http://haskell.org/hawiki/MonadState

-- Mark