diff --git a/alex-meta.cabal b/alex-meta.cabal
--- a/alex-meta.cabal
+++ b/alex-meta.cabal
@@ -1,5 +1,5 @@
 Name:                alex-meta
-Version:             0.3.0.10
+Version:             0.3.0.11
 Synopsis:            Quasi-quoter for Alex lexers
 -- Description:         
 License:             BSD3
@@ -28,6 +28,8 @@
     , base >= 4.2 && < 5
     , array, containers
     , QuickCheck >=2
+  if !impl(ghc >= 8.0)
+    Build-depends: semigroups == 0.19.*
 
   Build-tools: alex, happy
   
diff --git a/src/Data/Ranged/RangedSet.hs b/src/Data/Ranged/RangedSet.hs
--- a/src/Data/Ranged/RangedSet.hs
+++ b/src/Data/Ranged/RangedSet.hs
@@ -59,6 +59,7 @@
 import Data.Ranged.Boundaries
 import Data.Ranged.Ranges
 import Data.Monoid
+import Data.Semigroup as Sem
 
 import Data.List
 import Test.QuickCheck
@@ -72,11 +73,12 @@
 newtype RSet v = RSet {rSetRanges :: [Range v]}
    deriving (Eq, Show, Ord)
 
-instance DiscreteOrdered a => Semigroup (RSet a) where
+instance DiscreteOrdered a => Sem.Semigroup (RSet a) where
     (<>) = rSetUnion
 
 instance DiscreteOrdered a => Monoid (RSet a) where
     mempty = rSetEmpty
+    mappend = (Sem.<>)
 
 -- | Determine if the ranges in the list are both in order and non-overlapping.
 -- If so then they are suitable input for the unsafeRangedSet function.
