[Haskell-cafe] Ord (IORef a)?

John Meacham john at repetae.net
Tue Jun 22 22:52:42 EDT 2004


On Tue, Jun 22, 2004 at 11:54:17AM +0100, Simon Marlow wrote:
> I'm torn.  If it were free, it would be a no-brainer.  But I know of
> several cases where IORefs are performance-critical (or at least
> performance-important).  We should implement & measure.

Yeah, i forgot about the GC moving things around. actually, if the GC
could be coaxed to move things around, but never change the relative
order of IORefs (like a compacting collector), then the address could
still be used for Ord and Eq.

how is Eq implemented such that the GC doesn't move one side after you
read the address of the other?

Actually, the problem is exasperated by the fact we still havn't come up
with a good standard class to encapsulate references and the monads they
work in. If this were solved, then it would be much easier to use a
wrapper which includes an identity and would be a good addition to the
libraries. 
        John

-- 
John Meacham - ⑆repetae.net⑆john⑈ 


More information about the Haskell-Cafe mailing list