Added custom prelude.

We need this again because of Monoid/Semigroup.
This commit is contained in:
John MacFarlane 2018-03-16 10:08:38 -07:00
parent bc2f4422b2
commit e21b57991e
2 changed files with 38 additions and 8 deletions

View file

@ -398,6 +398,8 @@ library
http-client-tls >= 0.2.4 && < 0.4, http-client-tls >= 0.2.4 && < 0.4,
http-types >= 0.8 && < 0.13, http-types >= 0.8 && < 0.13,
case-insensitive >= 1.2 && < 1.3 case-insensitive >= 1.2 && < 1.3
if !impl(ghc >= 8.0)
build-depends: semigroups == 0.18.*
if os(windows) if os(windows)
cpp-options: -D_WINDOWS cpp-options: -D_WINDOWS
else else
@ -423,7 +425,7 @@ library
ScopedTypeVariables, GeneralizedNewtypeDeriving, ScopedTypeVariables, GeneralizedNewtypeDeriving,
RelaxedPolyRec, DeriveDataTypeable, TypeSynonymInstances, RelaxedPolyRec, DeriveDataTypeable, TypeSynonymInstances,
FlexibleInstances FlexibleInstances
hs-source-dirs: src hs-source-dirs: src, prelude
exposed-modules: Text.Pandoc, exposed-modules: Text.Pandoc,
Text.Pandoc.App, Text.Pandoc.App,
@ -508,7 +510,8 @@ library
Text.Pandoc.ImageSize, Text.Pandoc.ImageSize,
Text.Pandoc.BCP47, Text.Pandoc.BCP47,
Text.Pandoc.Class Text.Pandoc.Class
other-modules: Text.Pandoc.Filter, other-modules: Prelude,
Text.Pandoc.Filter,
Text.Pandoc.Filter.JSON, Text.Pandoc.Filter.JSON,
Text.Pandoc.Filter.Lua, Text.Pandoc.Filter.Lua,
Text.Pandoc.Filter.Path, Text.Pandoc.Filter.Path,
@ -568,14 +571,16 @@ executable pandoc
ScopedTypeVariables, GeneralizedNewtypeDeriving, ScopedTypeVariables, GeneralizedNewtypeDeriving,
RelaxedPolyRec, DeriveDataTypeable, TypeSynonymInstances, RelaxedPolyRec, DeriveDataTypeable, TypeSynonymInstances,
FlexibleInstances FlexibleInstances
hs-source-dirs: . hs-source-dirs: ., prelude
main-is: pandoc.hs main-is: pandoc.hs
buildable: True buildable: True
other-modules: Paths_pandoc other-modules: Paths_pandoc
Prelude
executable trypandoc executable trypandoc
main-is: trypandoc.hs main-is: trypandoc.hs
hs-source-dirs: trypandoc hs-source-dirs: trypandoc, prelude
other-modules: Prelude
default-language: Haskell2010 default-language: Haskell2010
if flag(trypandoc) if flag(trypandoc)
build-depends: base, aeson, pandoc, build-depends: base, aeson, pandoc,
@ -586,7 +591,8 @@ executable trypandoc
executable weigh-pandoc executable weigh-pandoc
main-is: weigh-pandoc.hs main-is: weigh-pandoc.hs
hs-source-dirs: benchmark hs-source-dirs: benchmark, prelude
other-modules: Prelude
if flag(weigh-pandoc) if flag(weigh-pandoc)
build-depends: pandoc, build-depends: pandoc,
base >= 4.2 && < 5, base >= 4.2 && < 5,
@ -602,7 +608,7 @@ executable weigh-pandoc
test-suite test-pandoc test-suite test-pandoc
type: exitcode-stdio-1.0 type: exitcode-stdio-1.0
main-is: test-pandoc.hs main-is: test-pandoc.hs
hs-source-dirs: test hs-source-dirs: test, prelude
build-depends: base >= 4.2 && < 5, build-depends: base >= 4.2 && < 5,
pandoc, pandoc,
pandoc-types >= 1.17.4 && < 1.18, pandoc-types >= 1.17.4 && < 1.18,
@ -631,7 +637,8 @@ test-suite test-pandoc
time >= 1.2 && < 1.5 time >= 1.2 && < 1.5
else else
build-depends: time >= 1.5 && < 1.10 build-depends: time >= 1.5 && < 1.10
other-modules: Tests.Old other-modules: Prelude
Tests.Old
Tests.Command Tests.Command
Tests.Helpers Tests.Helpers
Tests.Lua Tests.Lua
@ -684,7 +691,8 @@ test-suite test-pandoc
benchmark benchmark-pandoc benchmark benchmark-pandoc
type: exitcode-stdio-1.0 type: exitcode-stdio-1.0
main-is: benchmark-pandoc.hs main-is: benchmark-pandoc.hs
hs-source-dirs: benchmark hs-source-dirs: benchmark, prelude
other-modules: Prelude
build-depends: pandoc, build-depends: pandoc,
time, bytestring, containers, time, bytestring, containers,
base >= 4.2 && < 5, base >= 4.2 && < 5,

22
prelude/Prelude.hs Normal file
View file

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