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? ^^^^^^ -- Andre ----- Original Message ----- From: Tom Bevan <[EMAIL PROTECTED]> 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 functions > associated with it. > 1/ update - a function to update the state > 2/ retrieve - a function to retrieve the state from the monad > These two are inherited from the standard State monad > 3/ input - make a character from stndIn available to the state > transformation functions > 4/ output - send the state of the monad after a certain set of > transformations to stndOut > > I've managed to write functions 1-3 but not 4. > > Here's my work so far.I'm not really sure if this is on the right track. > > Tom > > > On Thu, 2002-01-24 at 14:32, Andre W B Furtado wrote: > > Hi, I have the same problem. Did anyone answered your question? > > > > Thanks, > > -- Andre > > > > ----- Original Message ----- > > From: Tom Bevan <[EMAIL PROTECTED]> > > To: Haskell Cafe List <[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 out, this means that > > > the IO Monad and the StateTransformation monad need to be composed into > > > a single highr order monad. > > > Does anyone have any references or pointers on how this should be done? > > > > > > > > > Tom > > > > > > > > > > > > _______________________________________________ > > > Haskell-Cafe mailing list > > > [EMAIL PROTECTED] > > > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > > > > > _______________________________________________ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe
