From 82b3e0ab97a67188f0886dd6b758aa8d0ccd1064 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 14 Oct 2015 09:09:10 -0700 Subject: Use custom Prelude to avoid compiler warnings. - The (non-exported) prelude is in prelude/Prelude.hs. - It exports Monoid and Applicative, like base 4.8 prelude, but works with older base versions. - It exports (<>) for mappend. - It hides 'catch' on older base versions. This allows us to remove many imports of Data.Monoid and Control.Applicative, and remove Text.Pandoc.Compat.Monoid. It should allow us to use -Wall again for ghc 7.10. --- prelude/Prelude.hs | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 prelude/Prelude.hs (limited to 'prelude') diff --git a/prelude/Prelude.hs b/prelude/Prelude.hs new file mode 100644 index 000000000..ca5c687ea --- /dev/null +++ b/prelude/Prelude.hs @@ -0,0 +1,39 @@ +{-# LANGUAGE PackageImports #-} +{-# LANGUAGE CPP #-} + +module Prelude +( + module P +, Monoid(..) +, Applicative(..) +#if MIN_VERSION_base(4,8,0) +#else +, (<$>) +, (<$) +#endif +, (<>) +) +where + +#if MIN_VERSION_base(4,8,0) +import "base" Prelude as P +import Data.Monoid ((<>)) +#elif MIN_VERSION_base(4,6,0) +import "base" Prelude as P +import Control.Applicative +import Data.Monoid +#else +import "base" Prelude as P hiding (catch) +import Control.Applicative +import Data.Monoid +#endif + +#if MIN_VERSION_base(4,5,0) +#else +infixr 6 <> + +-- | An infix synonym for 'mappend'. +(<>) :: Monoid m => m -> m -> m +(<>) = mappend +{-# INLINE (<>) #-} +#endif -- cgit v1.2.3