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.
This commit is contained in:
John MacFarlane 2013-08-08 10:41:39 -07:00
parent bb61624bb2
commit 802dc9a8b9
4 changed files with 19 additions and 2 deletions

View file

@ -335,6 +335,7 @@ Library
Text.Pandoc.ImageSize, Text.Pandoc.ImageSize,
Text.Pandoc.Slides, Text.Pandoc.Slides,
Text.Pandoc.Highlighting, Text.Pandoc.Highlighting,
Text.Pandoc.Compat.Monoid,
Paths_pandoc Paths_pandoc
Buildable: True Buildable: True

View file

@ -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

View file

@ -102,7 +102,7 @@ import Control.Applicative
import qualified Data.Text as T import qualified Data.Text as T
import Data.Text (Text) import Data.Text (Text)
import Data.Text.Encoding (encodeUtf8) import Data.Text.Encoding (encodeUtf8)
import Data.Monoid ((<>), Monoid(..)) import Text.Pandoc.Compat.Monoid ((<>), Monoid(..))
import Data.List (intersperse, nub) import Data.List (intersperse, nub)
import System.FilePath ((</>), (<.>)) import System.FilePath ((</>), (<.>))
import qualified Data.Map as M import qualified Data.Map as M

View file

@ -35,7 +35,7 @@ import qualified Data.ByteString.Lazy as BL
import qualified Data.ByteString.Lazy.Char8 as BL8 import qualified Data.ByteString.Lazy.Char8 as BL8
import qualified Data.Map as M import qualified Data.Map as M
import qualified Text.Pandoc.UTF8 as UTF8 import qualified Text.Pandoc.UTF8 as UTF8
import Data.Monoid ((<>)) import Text.Pandoc.Compat.Monoid ((<>))
import Codec.Archive.Zip import Codec.Archive.Zip
import Data.Time.Clock.POSIX import Data.Time.Clock.POSIX
import Text.Pandoc.Definition import Text.Pandoc.Definition