Data.HashMap: Strict or lazy by default?

Edward Kmett ekmett at gmail.com
Sat Feb 19 00:50:54 CET 2011


On Fri, Feb 18, 2011 at 6:36 PM, Isaac Dupree <
ml at isaac.cedarswampstudios.org> wrote:

> On 02/18/11 18:21, Edward Kmett wrote:
>>
>> Hrmm, the strict version will violate the laws for Functor:
>>
>> (fmap (const 12) . fmap error) /= fmap (const 12 . error)
>>
>
> That's an issue, though.  It means you can't use a Map that tries to keep
> its values always strict if you want to use class Functor with it.  *Even
> if* it's a separate type in Data.SomeMap.Strict. (Unless you're willing to
> break the law in the presence of _|_ values.)


That was pretty much my point. I think, as Jan-Willem put it, we are in
'violent agreement'. =)

-Edward
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20110218/0a3208ed/attachment-0001.htm>


More information about the Libraries mailing list