
apfelmus wrote:
An example:
lookup k (union m m') = lookup k m' `mplus` lookup k m
Shouldn't that be.. lookup k (union m m') = lookup k m `mplus` lookup k m' But I get confused by this, which is why I think it might be a good idea to deprecate union for Data.Map altogether. A related problem.. http://hackage.haskell.org/trac/ghc/ticket/1460 http://www.haskell.org/pipermail/libraries/2007-May/007491.html But I really think this discussion is somewhat moot as IMO the entire Data.Map module should be deprecated in favour of this.. http://darcs.haskell.org/packages/collections-ghc6.6/Data/Map/AVL.hs and ultimately this.. http://darcs.haskell.org/packages/collections-ghc6.6/Data.Trie.General/Data/... not that I'm in any way biased :-) But if we must stick with Data.Map for some reason then what Andriy is doing is worth while, the documentation does need improving. I found hardest thing about writing the clone was figuring out precisely what many of the functions did. (In many cases either the documentation was ambiguous, or it was OK but the implementation was not consistent with the docs.) Regards -- Adrian Hey