[Haskell-cafe] Documenting strictness properties for Data.Map.Strict

Johan Tibell johan.tibell at gmail.com
Fri Nov 18 17:06:29 CET 2011


On Fri, Nov 18, 2011 at 12:09 AM, Roman Cheplyaka <roma at ro-che.info> wrote:
> Is it mentioned anywhere that Map is spine-strict?

It's not and we should probably mention it.

I was mulling this over last night. My initial thought was that it
shouldn't matter as long as the algorithmic complexity of the
functions is maintained. But it is important in that a lookup
following an insert might do all the work of the insert, which is
somewhat surprising (and inefficient).

> An important property, although may be non-trivial to formulate while
> keeping the implementation abstract.

Perhaps we could talk about the presence or absence of thunks of a Map
that's in WHNF?

-- Johan



More information about the Haskell-Cafe mailing list