@@ -353,20 +353,16 @@ fromList : [(comparable,v)] -> Dict comparable v
353fromList assocs = List.foldl (\(k,v) d -> insert k v d) empty assocs
353fromList assocs = List.foldl (\(k,v) d -> insert k v d) empty assocs
355{-| Keep a key-value pair when it satisfies a predicate. -}
355{-| Keep a key-value pair when it satisfies a predicate. -}
356−filter : (comparable -> v -> Bool)
356+filter : (comparable -> v -> Bool) -> Dict comparable v -> Dict comparable v
357− -> Dict comparable v
358− -> Dict comparable v
359−filter p =
357+filter p dict =
360 let add k v t = if p k v then insert k v t else t
358 let add k v t = if p k v then insert k v t else t
361− in foldl add empty
359+ in foldl add empty dict
363{-| Partition the Dict according to a predicate. The first Dict contains all
361{-| Partition the Dict according to a predicate. The first Dict contains all
364key-value pairs which satisfy it; the second contains the rest. -}
362key-value pairs which satisfy it; the second contains the rest. -}
365−partition : (comparable -> v -> Bool)
366− -> Dict comparable v
367− -> (Dict comparable v, Dict comparable v)
363+partition : (comparable -> v -> Bool) -> Dict comparable v -> (Dict comparable v, Dict comparable v)
368−partition p =
364+partition p dict =
369 let add k v (t1, t2) = if p k v
365 let add k v (t1, t2) = if p k v
370 then (insert k v t1, t2)
366 then (insert k v t1, t2)
371 else (t1, insert k v t2)
367 else (t1, insert k v t2)
372− in foldl add (empty, empty)
368+ in foldl add (empty, empty) dict