[Haskell-beginners] Python's collections.defaultdict(list) in Haskell?
strombrg at gmail.com
Tue Nov 10 02:07:49 UTC 2015
I'm spending a little time here and there to learn some Haskell. I'm
coming from a chiefly Python/C/bash background.
I want to build a Data.Map where the keys are strings, and the values are
lists of strings.
In Python, collections.defaultdict(list) makes this pretty straightforward.
It gives a hash table ("dict") that has values that default to an empty
list, since list() produces an empty list. More info here:
Is there an equivalent in Haskell?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners