containers
containers copied to clipboard
Data.Map.mergeWithKey doesn't match documentation
The documentation for Data.Map.Lazy.mergeWithKey
states:
- a nonempty subtree present only in the first map is passed to
only1
and the output is added to the result;- a nonempty subtree present only in the second map is passed to
only2
and the output is added to the result.
Yet this example shows otherwise:
M.mergeWithKey
(\k x y -> traceShow ("merge", k, x, y) $ Just x)
(\m -> traceShow ("left", m) M.empty)
(\m -> traceShow ("right", m) M.empty)
M.empty
M.empty
`seq` ()
("right",fromList [])
()
The same isssue exists in the Strict version, and in both IntMap versions.