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 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 br

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

Re: Monad composition

2002-01-24 Thread Andre W B Furtado
gt; To: 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 f

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 http://www.md.chalmers.se/~rjmh/Combinators/MonadTransfo

Re: Monad composition

2002-01-23 Thread Tom Bevan
EMAIL PROTECTED]> > Sent: Wednesday, January 23, 2002 4:29 AM > 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