From a5fa55969f1b4afc0ca3e38be50b69c65d43a460 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel <albert@zeitkraut.de> Date: Sun, 15 Mar 2020 17:45:44 +0100 Subject: Use implicit Prelude (#6187) * Use implicit Prelude The previous behavior was introduced as a fix for #4464. It seems that this change alone did not fix the issue, and `stack ghci` and `cabal repl` only work with GHC 8.4.1 or newer, as no custom Prelude is loaded for these versions. Given this, it seems cleaner to revert to the implicit Prelude. * PandocMonad: remove outdated check for base version Only base versions 4.9 and later are supported, the check for `MIN_VERSION_base(4,8,0)` is therefore unnecessary. * Always use custom prelude Previously, the custom prelude was used only with older GHC versions, as a workaround for problems with ghci. The ghci problems are resolved by replacing package `base` with `base-noprelude`, allowing for consistent use of the custom prelude across all GHC versions. --- src/Text/Pandoc/App/CommandLineOptions.hs | 6 ++---- src/Text/Pandoc/App/FormatHeuristics.hs | 2 -- src/Text/Pandoc/App/Opt.hs | 2 -- src/Text/Pandoc/App/OutputSettings.hs | 2 -- 4 files changed, 2 insertions(+), 10 deletions(-) (limited to 'src/Text/Pandoc/App') diff --git a/src/Text/Pandoc/App/CommandLineOptions.hs b/src/Text/Pandoc/App/CommandLineOptions.hs index e232d7008..164ef17d5 100644 --- a/src/Text/Pandoc/App/CommandLineOptions.hs +++ b/src/Text/Pandoc/App/CommandLineOptions.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE CPP #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} @@ -22,7 +21,6 @@ module Text.Pandoc.App.CommandLineOptions ( , lookupHighlightStyle , setVariable ) where -import Prelude import Control.Monad import Control.Monad.Trans import Control.Monad.Except (throwError) @@ -32,7 +30,7 @@ import Data.Bifunctor (second) import Data.Char (toLower) import Data.List (intercalate, sort) #ifdef _WINDOWS -#if MIN_VERSION_base(4,12,0) +#if MIN_VERSION_base_noprelude(4,12,0) import Data.List (isPrefixOf) #endif #endif @@ -1030,7 +1028,7 @@ setVariable key val (Context ctx) = Context $ M.alter go key ctx -- beginning with \\ to \\?\UNC\. -- See #5127. normalizePath :: FilePath -> FilePath #ifdef _WINDOWS -#if MIN_VERSION_base(4,12,0) +#if MIN_VERSION_base_noprelude(4,12,0) normalizePath fp = if "\\\\" `isPrefixOf` fp && not ("\\\\?\\" `isPrefixOf` fp) then "\\\\?\\UNC\\" ++ drop 2 fp diff --git a/src/Text/Pandoc/App/FormatHeuristics.hs b/src/Text/Pandoc/App/FormatHeuristics.hs index 4b1830ee7..97eebe3b6 100644 --- a/src/Text/Pandoc/App/FormatHeuristics.hs +++ b/src/Text/Pandoc/App/FormatHeuristics.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {- | Module : Text.Pandoc.App.FormatHeuristics @@ -15,7 +14,6 @@ module Text.Pandoc.App.FormatHeuristics ( formatFromFilePaths ) where -import Prelude import Data.Char (toLower) import Data.Text (Text) import System.FilePath (takeExtension) diff --git a/src/Text/Pandoc/App/Opt.hs b/src/Text/Pandoc/App/Opt.hs index c8c717edc..d4b36bef3 100644 --- a/src/Text/Pandoc/App/Opt.hs +++ b/src/Text/Pandoc/App/Opt.hs @@ -1,6 +1,5 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TemplateHaskell #-} @@ -23,7 +22,6 @@ module Text.Pandoc.App.Opt ( , defaultOpts , addMeta ) where -import Prelude import Data.Char (isLower, toLower) import GHC.Generics hiding (Meta) import Text.Pandoc.Builder (setMeta) diff --git a/src/Text/Pandoc/App/OutputSettings.hs b/src/Text/Pandoc/App/OutputSettings.hs index d900e6ee5..139b408cb 100644 --- a/src/Text/Pandoc/App/OutputSettings.hs +++ b/src/Text/Pandoc/App/OutputSettings.hs @@ -1,6 +1,5 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} @@ -19,7 +18,6 @@ module Text.Pandoc.App.OutputSettings ( OutputSettings (..) , optToOutputSettings ) where -import Prelude import qualified Data.Map as M import qualified Data.Text as T import Text.DocTemplates (toVal, Context(..), Val(..)) -- cgit v1.2.3