git.iko.soy/typeable/pandoc
on master help sign in
New approach to custom Prelude.

We use no custom Prelude with the latest ghc version (8.4.1), so we don't have problems with ghci. See https://ghc.haskell.org/trac/ghc/ticket/10920 https://www.reddit.com/r/haskell/comments/3ryf2p/how_can_you_use_a_custom_prelude_with_ghci/ This may help with #4464.

commitdd53545154c5149dc720cc34c9990b92aec78c1a authorJohn MacFarlane <jgm@berkeley.edu> dateSun 18 Mar 2018, 09:20 (9 years ago) parent09a32de
2 files changed+38−14
pandoc.cabal+31−7 prelude/Prelude.hs+7−7
pandoc.cabal+31−7
@@ -11,7 +11,7 @@ bug-reports: https://github.com/jgm/pandoc/issues
1111stability: alpha
1212homepage: https://pandoc.org
1313category: Text
14−tested-with: GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2
14+tested-with: GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.1
1515synopsis: Conversion between markup formats
1616description: Pandoc is a Haskell library for converting from one markup
1717 format to another, and a command-line tool that uses
@@ -398,8 +398,12 @@ library
398398 http-client-tls >= 0.2.4 && < 0.4,
399399 http-types >= 0.8 && < 0.13,
400400 case-insensitive >= 1.2 && < 1.3
401− if !impl(ghc >= 8.0)
401+ if impl(ghc < 8.0)
402402 build-depends: semigroups == 0.18.*
403+ if impl(ghc < 8.4)
404+ hs-source-dirs: prelude
405+ other-modules: Prelude
406+ build-depends: base-compat >= 0.9
403407 if os(windows)
404408 cpp-options: -D_WINDOWS
405409 else
@@ -563,8 +567,12 @@ library
563567
564568executable pandoc
565569 build-depends: pandoc, base >= 4.7 && < 5
566− if !impl(ghc >= 8.0)
570+ if impl(ghc < 8.0)
567571 build-depends: semigroups == 0.18.*
572+ if impl(ghc < 8.4)
573+ hs-source-dirs: prelude
574+ other-modules: Prelude
575+ build-depends: base-compat >= 0.9
568576 ghc-options: -rtsopts -with-rtsopts=-K16m -Wall -fno-warn-unused-do-bind -threaded
569577 if flag(static)
570578 ld-options: -static
@@ -590,8 +598,12 @@ executable trypandoc
590598 buildable: True
591599 else
592600 buildable: False
593− if !impl(ghc >= 8.0)
601+ if impl(ghc < 8.0)
594602 build-depends: semigroups == 0.18.*
603+ if impl(ghc < 8.4)
604+ hs-source-dirs: prelude
605+ other-modules: Prelude
606+ build-depends: base-compat >= 0.9
595607
596608executable weigh-pandoc
597609 main-is: weigh-pandoc.hs
@@ -606,8 +618,12 @@ executable weigh-pandoc
606618 buildable: True
607619 else
608620 buildable: False
609− if !impl(ghc >= 8.0)
621+ if impl(ghc < 8.0)
610622 build-depends: semigroups == 0.18.*
623+ if impl(ghc < 8.4)
624+ hs-source-dirs: prelude
625+ other-modules: Prelude
626+ build-depends: base-compat >= 0.9
611627 ghc-options: -rtsopts -Wall -fno-warn-unused-do-bind
612628 default-language: Haskell98
613629
@@ -638,8 +654,12 @@ test-suite test-pandoc
638654 zip-archive >= 0.2.3.4 && < 0.4,
639655 xml >= 1.3.12 && < 1.4,
640656 Glob >= 0.7 && < 0.10
641− if !impl(ghc >= 8.0)
657+ if impl(ghc < 8.0)
642658 build-depends: semigroups == 0.18.*
659+ if impl(ghc < 8.4)
660+ hs-source-dirs: prelude
661+ other-modules: Prelude
662+ build-depends: base-compat >= 0.9
643663 if flag(old-locale)
644664 build-depends: old-locale >= 1 && < 1.1,
645665 time >= 1.2 && < 1.5
@@ -706,7 +726,11 @@ benchmark benchmark-pandoc
706726 base >= 4.2 && < 5,
707727 text >= 0.11 && < 1.3,
708728 criterion >= 1.0 && < 1.5
709− if !impl(ghc >= 8.0)
729+ if impl(ghc < 8.0)
710730 build-depends: semigroups == 0.18.*
731+ if impl(ghc < 8.4)
732+ hs-source-dirs: prelude
733+ other-modules: Prelude
734+ build-depends: base-compat >= 0.9
711735 ghc-options: -rtsopts -Wall -fno-warn-unused-do-bind
712736 default-language: Haskell98
prelude/Prelude.hs+7−7
@@ -1,17 +1,17 @@
1+{-# LANGUAGE NoImplicitPrelude #-}
12{-# LANGUAGE PackageImports #-}
23{-# LANGUAGE CPP #-}
34
5+-- The intent is that this Prelude provide the API of
6+-- the base 4.11 Prelude in a way that is portable for
7+-- all base versions.
8+
49module Prelude
510(
6− module P
7−, Monoid(..)
11+ module Prelude.Compat
812, Semigroup(..)
9−, Applicative(..)
1013)
1114where
1215
13−import "base" Prelude as P
16+import Prelude.Compat
1417import Data.Semigroup (Semigroup(..)) -- includes (<>)
15−#if MIN_VERSION_base(4,11,0)
16−import Data.Monoid (Monoid(..))
17−#endif