aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-03-16 08:21:52 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-03-16 08:21:52 -0700
commit8360f9dedfc7298c2807c2e0911dd51fc2acbc3e (patch)
treea7189419001d7db9cf2f290338bff4d1423a4c4b /src
parent0cbb811f3d306f33299c2122c3ccc8f77642884c (diff)
downloadpandoc-8360f9dedfc7298c2807c2e0911dd51fc2acbc3e.tar.gz
Translations: Semigroup instance for Translations with base >= 4.9.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Translations.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Translations.hs b/src/Text/Pandoc/Translations.hs
index 949618178..cc4b1ebba 100644
--- a/src/Text/Pandoc/Translations.hs
+++ b/src/Text/Pandoc/Translations.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-
@@ -80,7 +81,11 @@ data Term =
deriving (Show, Eq, Ord, Generic, Enum, Read)
newtype Translations = Translations (M.Map Term String)
+#if MIN_VERSION_base(4,9,0)
+ deriving (Show, Generic, Semigroup, Monoid)
+#else
deriving (Show, Generic, Monoid)
+#endif
instance FromJSON Term where
parseJSON (String t) = case safeRead (T.unpack t) of