Proposal: IntMap.differenceKeysSet for removing an IntSet of keys

Liyang HU haskell.org at liyang.hu
Fri Jun 10 04:17:38 CEST 2011


On 10 June 2011 10:09, Felipe Almeida Lessa <felipe.lessa at gmail.com> wrote:
> If we had something like fromIntSet :: IntSet -> IntMap ()
> then at least we could have a RULE to convert "difference m
> (fromIntSet s)" to "differenceIntSet m s".  Then we could just hide
> differenceIntSet and the name wouldn't matter.  Perhaps this
> "fromIntSet" function should be proposed as well?

Sure, that sounds quite reasonable. Have done that as patch 0005 on
the ticket. I've generalised it a bit to:

    fromSet :: (Key -> a) -> IntSet -> IntMap a

Which version does everyone prefer? differenceKeysSet m s, or
difference m (fromSet f s) ?

Cheers,
/Liyang



More information about the Libraries mailing list