RealWorld

Ross Paterson ross@soi.city.ac.uk
Thu, 11 Sep 2003 16:56:22 +0100


On Thu, Sep 11, 2003 at 04:40:07PM +0100, Alastair Reid wrote:
> 
> > This constrains the implementations of IORef and STRef to be the same
> > (obviously).  I can't immediately see any benefit from using different
> > implementations for these two types, so maybe it's not an issue.
> 
> I could be a bit out of date but I think Hugs uses different implementations 
> because IO has concurrency and exceptions and ST doesn't.  Apart from effort 
> required, I don't know if there is any cost in switching.

I think IORef and STRef have both been MUTVAR as far back as I can see.
The IO and (strict) ST monads used to be very different, and no longer
are (so they both use the same state primitives now), but I don't think
this affects the IORef = STRef IOState question.