[Haskell-cafe] RFC: concurrent-extra

Roel van Dijk vandijk.roel at gmail.com
Wed Feb 17 04:56:41 EST 2010

2010/2/17 Neil Brown <nccb2 at kent.ac.uk>:
> You don't need to do use ThreadId: MVar has an Eq instance, so you could
> make your Lock type derive an Eq instance, and then you can just compare the
> Locks to remove it after the timeout occurs (e.g. using delete to take it
> out of the list; it should be quite near the head of the list anyway).  In
> fact, you may as well make most of your types derive an Eq instance where
> possible, as this can be useful sometimes.

Now I am wondering why I didn't think of that before. It's an elegant
solution. Thanks!

More information about the Haskell-Cafe mailing list