opensubscriber
   Find in this group all groups
 
The Haskell Cafe more information…

h : haskell-cafe@haskell.org 19 November 2008 • 7:56PM -0500

Re: [Haskell-cafe] implementing python-style dictionary in Haskell
by Ketil Malde

REPLY TO AUTHOR
 
REPLY TO GROUP




Tillmann Rendel <rendel@daim...> writes:

> Why should a Haskell hash table need more memory then a Python hash
> table? I've heard that Data.HashTable is bad, so maybe writing a good
> one could be an option.

One problem is that Haskell collections are lazy by default.  I'm
aware of a few use cases where laziness lets you formulate a very
elegant recursive population of a collection, but I think that in
general, strictness is what you want, and further, that if you want
lazy, you store your data as one-tuples: data Lazy a = Lazy a  

(If there's a workaround/solution in the other direction, I'd really
like to hear it).

I'm therefore tempted to suggest that collections should be
strict by default, and in particular, that there should be strict
arrays for arbitrary types, not just the ones that happen to be
unboxable. Unboxing should be an optimization for (some) strict
arrays.

-k
--
If I haven't seen further, it is by standing in the footprints of giants
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@hask...
http://www.haskell.org/mailman/listinfo/haskell-cafe

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.