#5242: IntMap.differenceKeysSet for removing an IntSet of keys
---------------------------------+------------------------------------------
    Reporter:  liyang            |       Owner:                   
        Type:  feature request   |      Status:  new              
    Priority:  normal            |   Component:  libraries (other)
     Version:  7.1               |    Keywords:  containers       
    Testcase:                    |   Blockedby:                   
          Os:  Unknown/Multiple  |    Blocking:                   
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown     
---------------------------------+------------------------------------------
 Currently, {{{IntMap.difference ma mb}}} removes all the keys in `mb` from
 `ma`, where the elements of the two `IntMap`s can be of different types;
 the elements of `mb` are not used.

 There is no efficient way to remove an `IntSet` of keys, however. These
 patches adds the `IntMap.differenceKeysSet` function—essentially a
 copy/paste of `difference`—that satisfies the following property:
 {{{
 prop_DiffKeysSet :: Map Int -> Map () -> Bool
 prop_DiffKeysSet t1 t2
   = difference t1 t2 == differenceKeysSet t1 (keysSet t2)
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5242>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to