[Haskell-cafe] Why no IO transformer monad?
k.schupke at imperial.ac.uk
Mon Dec 20 10:19:27 EST 2004
Ross Paterson wrote:
On the haskell list it has almost been decided that (ST RealWorld a) and
_should_ merge and become the same thing.
>On Mon, Dec 20, 2004 at 02:16:52PM +0000, Keean Schupke wrote:
>>Surely if IO is (ST RealWorld a) then (StateT RealWorld m a) is more or
>>less the right thing?
>But IO is not ST RealWorld (even if GHC pretends it is): other users
>of the world are not waiting for the new world produced by your Haskell
>IO is more accurately modelled by a resumption monad, cf
>That suggests a possible monad transformer:
> data IOT m a = Return a | Invoke (m (SysCall (IOT m a)))
>but with no way to define runIOT :: Monad m => IOT m a -> IO (...),
>it's not much use.
More information about the Haskell-Cafe