[Haskell] IO == ST RealWorld

Simon Peyton-Jones simonpj at microsoft.com
Tue Jan 24 04:17:20 EST 2006


| Is there any reason why IO should not be defined as:
|   > type IO a = ST RealWorld a
| in implementations that support ST?
| 
| This way IORef/STRef and IOArray/STArray can be merged. I know under
the
| hood they already share code, but this way they can also share an
interface.

Indeed, this was the way we had it originally in GHC.  It does seem like
a good idea.  We changed it for reasons that I know that we have
forgotten, alas, because we tried to recall about a year ago.   It's
always possible that the original reasons for the change no longer
apply.

Perhaps someone can try it out?

Simon


More information about the Haskell mailing list