on master help sign in
Fix Set.{filter,partition}
commitd1d687db462bc9f1ac7a00e4becfa05afbbdad9e authorHarry Garrood <harry@garrood.me> dateWed 16 Apr 2014, 17:45 (13 years ago) parenta24ef36
1 file changed+2−2
libraries/Set.elm+2−2
libraries/Set.elm+2−2
@@ -92,11 +92,11 @@ map f s = fromList (List.map f (toList s))
9292
9393{-| Create a new set consisting only of elements which satisfy a predicate. -}
9494filter : (comparable -> Bool) -> Set comparable -> Set comparable
95−filter p = Dict.filter p
95+filter p = Dict.filterWithKey (\k _ -> p k)
9696
9797{-| Create two new sets; the first consisting of elements which satisfy a
9898predicate, the second consisting of elements which do not. -}
9999partition : (comparable -> Bool)
100100 -> Set comparable
101101 -> (Set comparable, Set comparable)
102−partition p = Dict.partition p
102+partition p = Dict.partitionWithKey (\k _ -> p k)