Improve query functions of Map and Set.
authorMilan Straka <fox@ucw.cz>
Sat, 21 Apr 2012 19:41:22 +0000 (21:41 +0200)
committerMilan Straka <fox@ucw.cz>
Sat, 21 Apr 2012 19:41:22 +0000 (21:41 +0200)
commit78c1e523a6dacb092da6fa2deef04d498fd588a3
tree1bd6fa8b99aa4556ee1d79d18bb0c285cbfd1d91
parent0928ff026a70b759be060f6ea46a48c58957049c
Improve query functions of Map and Set.

As documented in the Note: Local 'go' functions and capturing,
it is safe to use captured key argument in query functions.

Also, in order to decrease allocation, the query functions in Map
are manually inlined, so 'member' does not have to call 'lookup'
and heap-allocate 'Just a'.

Tests of query functions are much improved too.
Data/Map/Base.hs
Data/Map/Strict.hs
Data/Set.hs
tests/map-properties.hs
tests/set-properties.hs