Improve docs for DA.Next.Set.difference (#6544)

changelog_begin
changelog_end
This commit is contained in:
Moritz Kiefer 2020-06-30 17:28:47 +02:00 committed by GitHub
parent 6213f560ef
commit 5c0cfcc254
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,7 +96,11 @@ union (Set t1) (Set t2) = Set $ TextMap.union t1 t2
intersection : MapKey a => Set a -> Set a -> Set a
intersection s1 s2 = filter (`member` s2) s1
-- | Difference of two sets.
-- | `difference x y` returns the set consisting of all
-- elements in `x` that are not in `y`.
--
-- >>> fromList [1, 2, 3] `difference` fromList [1, 4]
-- fromList [2, 3]
difference : MapKey a => Set a -> Set a -> Set a
difference s1 s2 = filter (\x -> not (x `member` s2)) s1