-
-
Save betaboon/a88a14621bda6955b28f44f9fc9cc75c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Data/Ranged/RangedSet.hs b/Data/Ranged/RangedSet.hs | |
index eca86ef..915db37 100644 | |
--- a/Data/Ranged/RangedSet.hs | |
+++ b/Data/Ranged/RangedSet.hs | |
@@ -72,8 +72,10 @@ infixl 5 -<=-, -<-, -?- | |
newtype DiscreteOrdered v => RSet v = RSet {rSetRanges :: [Range v]} | |
deriving (Eq, Show) | |
+instance DiscreteOrdered a => Semigroup (RSet a) where | |
+ (<>) = rSetUnion | |
+ | |
instance DiscreteOrdered a => Monoid (RSet a) where | |
- mappend = rSetUnion | |
mempty = rSetEmpty | |
-- | Determine if the ranges in the list are both in order and non-overlapping. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment