Require ghc >= 8.6, base >= 4.12.

This allows us to get rid of the old custom prelude and
some crufty cpp.  But the primary reason for this is that
conduit has bumped its base lower bound to 4.12, making it
impossible for us to support lower base versions.
This commit is contained in:
John MacFarlane 2021-11-09 23:43:12 -08:00
parent 6bec746074
commit 03f9a0c61e
5 changed files with 15 additions and 50 deletions

View file

@ -43,20 +43,10 @@ jobs:
fail-fast: true
matrix:
versions:
- ghc: '8.2.2'
cabal: '2.4'
prefix: 'v2-'
cabalopts: ''
testopts: ''
- ghc: '8.4.4'
cabal: '2.4'
prefix: 'v2-'
cabalopts: '-f-embed_data_files'
testopts: ''
- ghc: '8.6.5'
cabal: '3.2'
prefix: ''
cabalopts: ''
cabalopts: '-f-embed_data_files'
testopts: '--test-option=--hide-successes --test-option=--ansi-tricks=false'
- ghc: '8.8.4'
cabal: '3.2'

View file

@ -1,5 +1,5 @@
packages: pandoc.cabal
tests: True
flags: +embed_data_files
constraints: aeson >= 2.0.1.0, transformers >= 0.5.6
constraints: aeson >= 2.0.1.0

View file

@ -409,31 +409,27 @@ flag trypandoc
common common-options
default-language: Haskell2010
build-depends: base >= 4.9 && < 5
build-depends: base >= 4.12 && < 5
ghc-options: -Wall -fno-warn-unused-do-bind
-Wincomplete-record-updates
-Wnoncanonical-monad-instances
-Wcpp-undef
-Wincomplete-uni-patterns
-Widentities
-Wpartial-fields
-Wmissing-signatures
-fhide-source-paths
-- -Wmissing-export-lists
if impl(ghc < 8.6)
hs-source-dirs: prelude
other-modules: Prelude
build-depends: base-compat >= 0.10.5
other-extensions: NoImplicitPrelude
if impl(ghc >= 8.10)
ghc-options: -Wunused-packages
if impl(ghc >= 9.0)
ghc-options: -Winvalid-haddock
if os(windows)
cpp-options: -D_WINDOWS
-- Later:
-- -Wpartial-fields (currently used in Powerpoint writer)
-- -Wmissing-export-lists (currently some Odt modules violate this)
-- -Wredundant-constraints (problematic if we want to support older base)
if impl(ghc >= 8.2)
ghc-options: -Wcpp-undef
if impl(ghc >= 8.4)
ghc-options: -Wincomplete-uni-patterns
-Widentities
-fhide-source-paths
common common-executable
import: common-options
build-depends: pandoc

View file

@ -1,15 +0,0 @@
{-# LANGUAGE NoImplicitPrelude #-}
-- The intent is that this Prelude provide the API of
-- the base 4.11 Prelude in a way that is portable for
-- all base versions.
module Prelude
(
module Prelude.Compat
, Semigroup(..)
)
where
import Prelude.Compat
import Data.Semigroup (Semigroup(..)) -- includes (<>)

View file

@ -33,10 +33,8 @@ import Data.Bifunctor (second)
import Data.Char (toLower)
import Data.List (intercalate, sort, foldl')
#ifdef _WINDOWS
#if MIN_VERSION_base(4,12,0)
import Data.List (isPrefixOf)
#endif
#endif
import Data.Maybe (fromMaybe, isJust)
import Data.Text (Text)
import Safe (tailDef)
@ -1078,7 +1076,6 @@ readMetaValue s
-- beginning with \\ to \\?\UNC\. -- See #5127.
normalizePath :: FilePath -> FilePath
#ifdef _WINDOWS
#if MIN_VERSION_base(4,12,0)
normalizePath fp =
if "\\\\" `isPrefixOf` fp && not ("\\\\?\\" `isPrefixOf` fp)
then "\\\\?\\UNC\\" ++ drop 2 fp
@ -1086,6 +1083,3 @@ normalizePath fp =
#else
normalizePath = id
#endif
#else
normalizePath = id
#endif