RFC: Should Data.IntMap.Strict be value-strict in the function arguments or the map itself

Johan Tibell johan.tibell at gmail.com
Thu Oct 27 19:22:26 CEST 2011

On Thu, Oct 27, 2011 at 10:17 AM, Edward Z. Yang <ezyang at mit.edu> wrote:

> Here's the definition of Tip.
>    data IntMap a = Bin {-# UNPACK #-} !Prefix {-# UNPACK #-} !Mask !(IntMap
> a) !(IntMap a)
>                  | Tip {-# UNPACK #-} !Key a
>                  | Nil

You're right. I forgot the definition of the data type itself. I guess
there's no function in the API currently that takes a key parameter and
isn't strict in that parameter because the key is either

 * compared to another key, or
 * inserted into the map

which both causes the key to be evaluated.

-- Johan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20111027/6812bc8c/attachment.htm>

More information about the Libraries mailing list