[Haskell-cafe] Documenting strictness properties for Data.Map.Strict
Johan Tibell
johan.tibell at gmail.com
Fri Nov 18 06:21:47 CET 2011
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
I'm not entirely happy with this formulation. I'm looking for
something that's clear (i.e. precise and concise, without leaving out
important information), assuming that the reader already knows how
lazy evaluation works at a high level.
Ideas?
Cheers,
Johan
More information about the Haskell-Cafe
mailing list