Re: Monad composition

2002-01-25 Thread John Hughes
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? ^^

Re: Monad composition

2002-01-24 Thread John Hughes
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

Re: Monad composition

2002-01-24 Thread Andre W B Furtado
[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

Re: Monad composition

2002-01-24 Thread Theodore Norvell
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

Re: Monad composition

2002-01-24 Thread Rijk-Jan van Haaften
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

Re: Monad composition

2002-01-23 Thread Tom Bevan
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