The easiest way to combine State and IO is using a monad transformer. There
are some lecture notes which you might find useful at

        http://www.md.chalmers.se/~rjmh/Combinators/Monads/index.htm

which refer to a library module

        http://www.md.chalmers.se/~rjmh/Combinators/MonadTransformers.hs

Using this library you just build the type

        type StateIO s a = State s IO a

which is a monad with operations readState, writeState, and

        lift :: IO a -> StateIO s a

John 

_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to