aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Compat
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2013-08-08 10:41:39 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2013-08-08 10:41:39 -0700
commit802dc9a8b9f206eb3be592ab19067f637eb2a3ee (patch)
tree6a022f707773924c14d46b48c2fdb5b09d72c983 /src/Text/Pandoc/Compat
parentbb61624bb2bba416e1992ecdf101f9660a3edcae (diff)
downloadpandoc-802dc9a8b9f206eb3be592ab19067f637eb2a3ee.tar.gz
Added Text.Pandoc.Compat.Monoid.
This allows pandoc to compile with base < 4.5, where Data.Monoid doesn't export `<>`. Thanks to Dirk Ullirch for the patch.
Diffstat (limited to 'src/Text/Pandoc/Compat')
-rw-r--r--src/Text/Pandoc/Compat/Monoid.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Compat/Monoid.hs b/src/Text/Pandoc/Compat/Monoid.hs
new file mode 100644
index 000000000..80ffcbbd6
--- /dev/null
+++ b/src/Text/Pandoc/Compat/Monoid.hs
@@ -0,0 +1,16 @@
+{-# LANGUAGE CPP #-}
+module Text.Pandoc.Compat.Monoid ( Monoid(..)
+ , (<>)
+ ) where
+
+#if MIN_VERSION_base(4,5,0)
+import Data.Monoid ((<>), Monoid(..))
+#else
+import Data.Monoid (mappend, Monoid(..))
+#endif
+
+#if MIN_VERSION_base(4,5,0)
+#else
+(<>) :: Monoid m => m -> m -> m
+(<>) = mappend
+#endif