@@ -42,10 +42,15 @@ export
42difference : (x, y : SortedSet k) -> SortedSet k
42difference : (x, y : SortedSet k) -> SortedSet k
43difference x y = foldr delete x y
43difference x y = foldr delete x y
45−||| Set intersection. Uses the union of the differences.
45+||| Set symetric difference. Uses the union of the differences.
47+symDifference : (x, y : SortedSet k) -> SortedSet k
48+symDifference x y = union (difference x y) (difference y x)
50+||| Set intersection. Implemented as the difference of the union and the symetric difference.
47intersection : (x, y : SortedSet k) -> SortedSet k
52intersection : (x, y : SortedSet k) -> SortedSet k
48−intersection x y = union (difference x y) (difference y x)
53+intersection x y = difference (union x y) (symDifference x y)
50Ord k => Semigroup (SortedSet k) where
55Ord k => Semigroup (SortedSet k) where
51 (<+>) = union
56 (<+>) = union