[Haskell-cafe] Re: Collections

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Fri Jun 22 01:55:13 EDT 2007


On Fri, 2007-06-22 at 15:34 +1000, Thomas Conway wrote:
> On 6/22/07, Duncan Coutts <duncan.coutts at worc.ox.ac.uk> wrote:
> > You might find that lazy IO is helpful in this case. The primitive that
> > implements lazy IO is unsafeInterleaveIO :: IO a -> IO a
> 
> Personally, unsafeInterleaveIO is so horribly evil, that even just
> having typed the name, I'll have to put the keyboard through the
> dishwasher (see http://www.coudal.com/keywasher.php). Also, I need to
> support concurrent querying and updates, and trying to manage the
> locking is quite hard enough as it is, without trying to keep track of
> which postings vectors have closures pointing to them!

Ah yes, fair enough. If you're doing updates at the same time then lazy
IO isn't appropriate as you need control over when the IO happens.

Duncan



More information about the Haskell-Cafe mailing list