on master help sign in
Changed `intersection` to use a more efficient implementation
f1c4090Synthetica9
libs/contrib/Data/SortedSet.idr+1−1
@@ -50,7 +50,7 @@ symDifference x y = union (difference x y) (difference y x)
50||| Set intersection. Implemented as the difference of the union and the symetric difference.
50||| Set intersection. Implemented as the difference of the union and the symetric difference.
51export
51export
52intersection : (x, y : SortedSet k) -> SortedSet k
52intersection : (x, y : SortedSet k) -> SortedSet k
53−intersection x y = difference (union x y) (symDifference x y)
53+intersection x y = difference x (difference x y)
54
54
55Ord k => Semigroup (SortedSet k) where
55Ord k => Semigroup (SortedSet k) where
56 (<+>) = union
56 (<+>) = union