Changed `intersection` to use a more efficient implementation
Thanks @clayrat.
commitf1c4090c63542c2d57374b647d728d15128c0787
authorSynthetica9 <patrickhilhorst97@gmail.com>
dateWed 19 Apr 2017, 14:36 (10 years ago)
parent1b8afb1
libs/contrib/Data/SortedSet.idr+1−1
@@ -50,7 +50,7 @@ symDifference x y = union (difference x y) (difference y x)
5050||| Set intersection. Implemented as the difference of the union and the symetric difference.
5151export
5252intersection : (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)
5454
5555Ord k => Semigroup (SortedSet k) where
5656 (<+>) = union