[Haskell-cafe] Optimizing hash array mapped tries

Don Stewart dons at galois.com
Wed Feb 24 16:13:38 EST 2010


ezyang:
> Excerpts from Bulat Ziganshin's message of Wed Feb 24 14:48:53 -0500 2010:
> > > I'd be really curious about techniques that permit mutation during
> > > the construction of functional datastructures; this seems like a cool
> > > way to get fast performance w/o giving up any of the benefits of
> > > immutability.  Unfortunately, my (admittedly short) experiments in
> > > this domain ran up against the difficulty that vector didn't let me
> > > unsafely freeze its mutable version. :-)
> > 
> > actually, this technique is already used in haskell. look into array
> > library sources, search for freeze
> 
> Yup, I'm aware of this.  In fact, vector has thaw/freeze functions for
> itself, although it doesn't export them.  I'd rather not have to reimplement
> vector just to get this unsafe mutation capability tough (and since the
> mutable array GC problem is not fixed for the version of GHC I'm on, I'd likely
> see no benefit either).

These are exported from vector, though. 


More information about the Haskell-Cafe mailing list