Proposal: Add `restriction` to Data.Map and Data.IntMap
David Feuer
david.feuer at gmail.com
Thu Jul 14 16:02:51 UTC 2016
If you name it, it will come!
On Jul 14, 2016 11:55 AM, "Ross Paterson" <R.Paterson at city.ac.uk> wrote:
> On Thu, Jul 14, 2016 at 12:45:27AM -0400, David Feuer wrote:
> > Cale Gibbard proposes the following:
> >
> > Data.IntMap.restriction :: IntSet -> IntMap a -> IntMap a
> > Data.Map.restriction :: Ord k => Set k -> Map k a -> Map k a
> >
> > In each case, the map is filtered to contain only the keys that are
> > also found in the set. This can be implemented efficiently using a
> > slightly stripped-down version of Data.Map.intersection.
>
> One might also want the counterpart of Data.Map.difference for similar
> reasons.
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20160714/19b328f0/attachment.html>
More information about the Libraries
mailing list