aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-03-16 10:08:38 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-03-16 10:21:54 -0700
commite21b57991e589d88f50991b87c6ec01d350e9b22 (patch)
tree9318e623ab63dcef81de86ec19d69c8bebcde60a
parentbc2f4422b2cfab80882316cdd595bd38dbe723a3 (diff)
downloadpandoc-e21b57991e589d88f50991b87c6ec01d350e9b22.tar.gz
Added custom prelude.
We need this again because of Monoid/Semigroup.
-rw-r--r--pandoc.cabal24
-rw-r--r--prelude/Prelude.hs22
2 files changed, 38 insertions, 8 deletions
diff --git a/pandoc.cabal b/pandoc.cabal
index 5d3948d21..8989bd133 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -398,6 +398,8 @@ library
http-client-tls >= 0.2.4 && < 0.4,
http-types >= 0.8 && < 0.13,
case-insensitive >= 1.2 && < 1.3
+ if !impl(ghc >= 8.0)
+ build-depends: semigroups == 0.18.*
if os(windows)
cpp-options: -D_WINDOWS
else
@@ -423,7 +425,7 @@ library
ScopedTypeVariables, GeneralizedNewtypeDeriving,
RelaxedPolyRec, DeriveDataTypeable, TypeSynonymInstances,
FlexibleInstances
- hs-source-dirs: src
+ hs-source-dirs: src, prelude
exposed-modules: Text.Pandoc,
Text.Pandoc.App,
@@ -508,7 +510,8 @@ library
Text.Pandoc.ImageSize,
Text.Pandoc.BCP47,
Text.Pandoc.Class
- other-modules: Text.Pandoc.Filter,
+ other-modules: Prelude,
+ Text.Pandoc.Filter,
Text.Pandoc.Filter.JSON,
Text.Pandoc.Filter.Lua,
Text.Pandoc.Filter.Path,
@@ -568,14 +571,16 @@ executable pandoc
ScopedTypeVariables, GeneralizedNewtypeDeriving,
RelaxedPolyRec, DeriveDataTypeable, TypeSynonymInstances,
FlexibleInstances
- hs-source-dirs: .
+ hs-source-dirs: ., prelude
main-is: pandoc.hs
buildable: True
other-modules: Paths_pandoc
+ Prelude
executable trypandoc
main-is: trypandoc.hs
- hs-source-dirs: trypandoc
+ hs-source-dirs: trypandoc, prelude
+ other-modules: Prelude
default-language: Haskell2010
if flag(trypandoc)
build-depends: base, aeson, pandoc,
@@ -586,7 +591,8 @@ executable trypandoc
executable weigh-pandoc
main-is: weigh-pandoc.hs
- hs-source-dirs: benchmark
+ hs-source-dirs: benchmark, prelude
+ other-modules: Prelude
if flag(weigh-pandoc)
build-depends: pandoc,
base >= 4.2 && < 5,
@@ -602,7 +608,7 @@ executable weigh-pandoc
test-suite test-pandoc
type: exitcode-stdio-1.0
main-is: test-pandoc.hs
- hs-source-dirs: test
+ hs-source-dirs: test, prelude
build-depends: base >= 4.2 && < 5,
pandoc,
pandoc-types >= 1.17.4 && < 1.18,
@@ -631,7 +637,8 @@ test-suite test-pandoc
time >= 1.2 && < 1.5
else
build-depends: time >= 1.5 && < 1.10
- other-modules: Tests.Old
+ other-modules: Prelude
+ Tests.Old
Tests.Command
Tests.Helpers
Tests.Lua
@@ -684,7 +691,8 @@ test-suite test-pandoc
benchmark benchmark-pandoc
type: exitcode-stdio-1.0
main-is: benchmark-pandoc.hs
- hs-source-dirs: benchmark
+ hs-source-dirs: benchmark, prelude
+ other-modules: Prelude
build-depends: pandoc,
time, bytestring, containers,
base >= 4.2 && < 5,
diff --git a/prelude/Prelude.hs b/prelude/Prelude.hs
new file mode 100644
index 000000000..68e1b30f7
--- /dev/null
+++ b/prelude/Prelude.hs
@@ -0,0 +1,22 @@
+{-# LANGUAGE PackageImports #-}
+{-# LANGUAGE CPP #-}
+
+module Prelude
+(
+ module P
+, Monoid(..)
+, Semigroup(..)
+, Applicative(..)
+#if MIN_VERSION_base(4,9,0)
+-- <> is exported in Semigroup
+#else
+, (<>)
+#endif
+)
+where
+
+import "base" Prelude as P
+import Data.Semigroup (Semigroup(..)) -- includes (<>)
+#if MIN_VERSION_base(4,11,0)
+import Data.Monoid (Monoid(..))
+#endif