[Haskell-cafe] Documenting strictness properties for Data.Map.Strict
Roman Cheplyaka
roma at ro-che.info
Fri Nov 18 09:09:20 CET 2011
* Johan Tibell <johan.tibell at gmail.com> [2011-11-17 21:21:47-0800]
> Hi all,
>
> Data.Map is getting split into Data.Map.Lazy and Data.Map.Strict (with
> Data.Map re-exporting the lazy API). I want to better document the
> strictness properties of the two new modules. Right now the
> documentation for Data.Map.Strict reads:
>
> Strictness properties
> =====================
>
> * All functions are strict in both key and value arguments. Examples:
>
> insertWith (+) k undefined m == undefined
> delete undefined m == undefined
>
> * Keys and values are evaluated to WHNF before they are stored in the
> map. Examples:
>
> map (\ v -> undefined) == undefined
> mapKeys (\ k -> undefined) == undefined
Is it mentioned anywhere that Map is spine-strict?
An important property, although may be non-trivial to formulate while
keeping the implementation abstract.
--
Roman I. Cheplyaka :: http://ro-che.info/
More information about the Haskell-Cafe
mailing list