Andre W B Furtado wrote:
Well, it's also possible to interchange data between these two monads by:
unsafeIOToST :: IO a - ST s a
stToIO :: ST s a - IO a
Can anyone tell the possible problems related to
unsafeIOToST?
^^
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
[EMAIL PROTECTED]
Cc: Haskell Cafe List [EMAIL PROTECTED]
Sent: Thursday, January 24, 2002 4:13 AM
Subject: Re: Monad composition
Andre,
I can't work out how it should be done.
The way I see it, the StateIO monad should have four functions
associated with it.
1/ update - a function to update
Tom Bevan wrote:
Hi all,
I'm writing a programme which requires IO actions to be interleaved with
operations on a State monad. From what I can work out, this means that
the IO Monad and the StateTransformation monad need to be composed into
a single highr order monad.
Does anyone have
Andre W B Furtado wrote:
Well, it's also possible to interchange data between these two monads by:
unsafeIOToST :: IO a - ST s a
stToIO :: ST s a - IO a
Can anyone tell the possible problems related to
unsafeIOToST?
^^
Probably in the same manner as with unsafePerformIO:
it can break
Subject: Monad composition
Hi all,
I'm writing a programme which requires IO actions to be interleaved with
operations on a State monad. From what I can work out, this means that
the IO Monad and the StateTransformation monad need to be composed into
a single highr order monad