Data.IntMap/IntSet inconsistencies

2) the types are not general enough : like zip you should be able to take functions f : a->b->c instead of what intersectionWith forces you to do (f: a->b->a).
According to my documentation, the type of intersectionWith *is* (f :: a -> b -> c). On another note, with respect to my proposed change: I concede that it might be too general for some people. Here's a simpler change that I'd like: to be able to project information out of a value and modify it simultaneously, so simply alterProject :: (Maybe a -> (z, Maybe a)) -> k -> Map k a -> (z, Map k a ) for a specific key. and perhaps something similar for the min/max operations. I'd very much like to be able to do more general things than just min/max operations with this sort of generality -- hence the Alternative approach in my original proposal. Louis Wasserman wasserman.louis@gmail.com http://profiles.google.com/wasserman.louis

On Wed, Nov 4, 2009 at 11:57 AM, Louis Wasserman
According to my documentation, the type of intersectionWith is (f :: a -> b -> c).
apologies, i'm using 6.10 so apparently my containers library is out of date. i guess this is another reason to upgrade to 6.12: http://www.haskell.org/ghc/dist/current/docs/html/users_guide/release-6-12-1... 1.5.9.5. containers Version number 0.3.0.0 (was 0.2.0.1) mapAccumRWithKey has been added to Data.IntMap. A Traversable instance has been added to Data.IntMap.IntMap. The types of Data.IntMap.intersectionWith and Data.IntMap.intersectionWithKey have been changed from intersectionWith :: (a -> b -> a) -> IntMap a -> IntMap b -> IntMap a intersectionWithKey :: (Key -> a -> b -> a) -> IntMap a -> IntMap b -> IntMap a to intersectionWith :: (a -> b -> c) -> IntMap a -> IntMap b -> IntMap c intersectionWithKey :: (Key -> a -> b -> c) -> IntMap a -> IntMap b -> IntMap c b
participants (2)
-
Ben
-
Louis Wasserman