docs on Set, Map

Serge D. Mechveliani mechvel at
Sat Jun 4 07:11:26 EDT 2005

Dear GHC developers,

ghc-6.4 documentation specifies about  Map.insertWith
 insertWith :: Ord k => (a -> a -> a) -> k -> a -> Map k a -> Map k a

 O(log n). Insert with a combining function.

This description is not sufficient. For example, in 

  insertWith (\ a1 a2 -> a1) k a3 mp

the doc does not tell what value overrides on the key overlap,
a3  or the one in  mp. 

The usage of the GHC library for Set and Map will become much easier
if you fix this documentation point on all updating functions for 
Set and Map which use a combining function.


Serge Mechveliani
mechvel at

More information about the Glasgow-haskell-users mailing list