aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-03-16 08:11:00 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-03-16 08:11:10 -0700
commitec1e2c87b78e2f57e91a650bee329f083abec9bf (patch)
treeb8261970dffe46d2f19aa40e6be476a8c5634e66 /src/Text/Pandoc
parentdaa547562067459e29c33f655767693fa70f8498 (diff)
downloadpandoc-ec1e2c87b78e2f57e91a650bee329f083abec9bf.tar.gz
Semigroup instance for MediaBag with base >= 4.9.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/MediaBag.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Text/Pandoc/MediaBag.hs b/src/Text/Pandoc/MediaBag.hs
index 0d060fe1a..a962db674 100644
--- a/src/Text/Pandoc/MediaBag.hs
+++ b/src/Text/Pandoc/MediaBag.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-
@@ -50,7 +51,11 @@ import Text.Pandoc.MIME (MimeType, getMimeTypeDef)
-- can be used for an empty 'MediaBag', and '<>' can be used to append
-- two 'MediaBag's.
newtype MediaBag = MediaBag (M.Map [String] (MimeType, BL.ByteString))
+#if MIN_VERSION_base(4,9,0)
+ deriving (Semigroup, Monoid, Data, Typeable)
+#else
deriving (Monoid, Data, Typeable)
+#endif
instance Show MediaBag where
show bag = "MediaBag " ++ show (mediaDirectory bag)