IntMap intersectionWith type is too restrictive

Scott Dillard sedillard at ucdavis.edu
Fri May 16 12:18:39 EDT 2008


Hi,

This is a simple bug report, more or less. The type of
Data.IntMap.intersectionWith is too restrictive. Presently (GHC 8.2,
http://darcs.haskell.org/packages/containers/Data/) it's declared as
(a->b->a) -> IntMap a -> IntMap b -> IntMap a, but if you just remove
the type declarations it's inferred as (a->b->c) -> IntMap a -> IntMap
b -> IntMap c. Similarly for intersectionWithKey. The more general
a->b->c type is also the type of Data.Map.intersectionWith, and it's
quite useful, such as (intersectionWith (,))

Scott


More information about the Libraries mailing list