Data.IntMap: intersection function not sufficiently polymorphic

Axel Simon Axel.Simon at
Fri Sep 11 14:00:25 EDT 2009


the function

intersectionWith :: (a -> b -> a) -> IntMap a -> IntMap b -> IntMap a

in Data.IntMap creates a map of elements that occur in both maps. This
function can and should return a map of an arbitrary third type:

intersectionWith :: (a -> b -> c) -> IntMap a -> IntMap b -> IntMap c

This also applies to Data.IntMap.intersectionWithKey. Oddly enough, this
is already fixed in Data.Map.

Discussion period one week?!


More information about the Libraries mailing list