Data.IntMap: intersection function not sufficiently polymorphic

Hi, 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?! Cheers, Axel.

On Fri, Sep 11, 2009 at 08:00:25PM +0200, Axel Simon wrote:
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
Thanks for the report; this is already fixed in the HEAD by: Thu Oct 2 15:48:28 BST 2008 sedillard@gmail.com * correct type for IntMap.intersectionWith[Key] Thanks Ian
participants (2)
-
Axel Simon
-
Ian Lynagh