16 May 19:28
Re: IntMap intersectionWith type is too restrictive
From: Don Stewart <dons <at> galois.com>
Subject: Re: IntMap intersectionWith type is too restrictive
Newsgroups: gmane.comp.lang.haskell.libraries
Date: 2008-05-16 17:28:10 GMT
Subject: Re: IntMap intersectionWith type is too restrictive
Newsgroups: gmane.comp.lang.haskell.libraries
Date: 2008-05-16 17:28:10 GMT
sedillard: > 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 (,)) Can you submit a patch? This kind of thing comes up occasionally, and generalising the type is often safe and easy. -- Don
RSS Feed