Data.HashMap: Strict or lazy by default?
johan.tibell at gmail.com
Fri Feb 18 21:32:24 CET 2011
On Thu, Feb 17, 2011 at 4:51 PM, Johan Tibell <johan.tibell at gmail.com> wrote:
> My current thinking is to provide lazy and strict versions in
> different modules. The two modules could still share the same data
> type. The question is, what should be the default? Haskell is a lazy
> language but the most common use cases for maps are strict (e.g. a map
> from strings to integer counters).
What about class instances? With a shared data type we can only
provide one set of instances, probably the lazy ones. Assuming we used
to separate data types, can we even define instances for all common
classes (e.g. Functor, Foldable, Monoid) or will the strict versions
violate some of the laws for these classes?
More information about the Libraries