summaryrefslogtreecommitdiff
path: root/compiler/utils/OrdList.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/utils/OrdList.hs')
-rw-r--r--compiler/utils/OrdList.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/utils/OrdList.hs b/compiler/utils/OrdList.hs
index 4591b55978..f5362bb27f 100644
--- a/compiler/utils/OrdList.hs
+++ b/compiler/utils/OrdList.hs
@@ -21,6 +21,10 @@ import Outputable
#if __GLASGOW_HASKELL__ < 709
import Data.Monoid ( Monoid(..) )
#endif
+#if __GLASGOW_HASKELL__ > 710
+import Data.Semigroup ( Semigroup )
+import qualified Data.Semigroup as Semigroup
+#endif
infixl 5 `appOL`
infixl 5 `snocOL`
@@ -38,6 +42,11 @@ data OrdList a
instance Outputable a => Outputable (OrdList a) where
ppr ol = ppr (fromOL ol) -- Convert to list and print that
+#if __GLASGOW_HASKELL__ > 710
+instance Semigroup (OrdList a) where
+ (<>) = appOL
+#endif
+
instance Monoid (OrdList a) where
mempty = nilOL
mappend = appOL