type of stToIO
Ross Paterson
ross at soi.city.ac.uk
Fri Oct 6 07:05:19 EDT 2000
On Fri, Oct 06, 2000 at 02:56:52AM -0700, Simon Marlow wrote:
> GHC's stToIO currently has a different meaning: it embeds the ST
> computation into the I/O monad, using the fact that IO is an instance
> of ST. Or in other words, IO is just one distinguished state thread,
> which we're calling RealWorld.
I'd put that slightly differently: ST MainStore is a sub-monad of IO,
in the sense that there's an injective monad transformer between them,
namely stToIO. (So the mutable stuff in IO is an instance of the ST stuff.)
Of course internally they may be the same monad, but that's not what
the user would be told.
More information about the Glasgow-haskell-bugs
mailing list