diff --git a/extra/hledger-rewrite.hs b/extra/hledger-rewrite.hs index e10b1ac10..1f9237e1f 100755 --- a/extra/hledger-rewrite.hs +++ b/extra/hledger-rewrite.hs @@ -1,4 +1,5 @@ #!/usr/bin/env runhaskell +{-# LANGUAGE CPP #-} {-| hledger-rewrite [PATTERNS] --add-posting "ACCT AMTEXPR" ... @@ -22,7 +23,9 @@ Tested-with: hledger HEAD ~ 2014/2/4 -- hledger lib, cli and cmdargs utils import Hledger.Cli -- more utils for parsing -import Control.Applicative ((<*)) hiding (many) +#if !MIN_VERSION_base(4,8,0) +import Control.Applicative.Compat ((<*)) +#endif import Text.Parsec diff --git a/hledger-lib/Hledger/Data/Dates.hs b/hledger-lib/Hledger/Data/Dates.hs index a78adc2a2..17ff04835 100644 --- a/hledger-lib/Hledger/Data/Dates.hs +++ b/hledger-lib/Hledger/Data/Dates.hs @@ -64,7 +64,9 @@ module Hledger.Data.Dates ( ) where -import Control.Applicative ((<*)) +#if !MIN_VERSION_base(4,8,0) +import Control.Applicative.Compat ((<*)) +#endif import Control.Monad import Data.List import Data.Maybe diff --git a/hledger-lib/Hledger/Data/OutputFormat.hs b/hledger-lib/Hledger/Data/OutputFormat.hs index 630ce2ab9..ba54049a4 100644 --- a/hledger-lib/Hledger/Data/OutputFormat.hs +++ b/hledger-lib/Hledger/Data/OutputFormat.hs @@ -1,4 +1,5 @@ {-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE CPP #-} module Hledger.Data.OutputFormat ( parseStringFormat , formatsp @@ -8,8 +9,10 @@ module Hledger.Data.OutputFormat ( , tests ) where -import Control.Applicative ((<*)) import Numeric +#if !MIN_VERSION_base(4,8,0) +import Control.Applicative.Compat ((<*)) +#endif import Data.Char (isPrint) import Data.Maybe import Test.HUnit diff --git a/hledger-lib/Hledger/Read/CsvReader.hs b/hledger-lib/Hledger/Read/CsvReader.hs index ae7324418..c8723f2d0 100644 --- a/hledger-lib/Hledger/Read/CsvReader.hs +++ b/hledger-lib/Hledger/Read/CsvReader.hs @@ -20,7 +20,9 @@ module Hledger.Read.CsvReader ( tests_Hledger_Read_CsvReader ) where -import Control.Applicative ((<$>), (<*)) +#if !MIN_VERSION_base(4,8,0) +import Control.Applicative.Compat ((<$>), (<*)) +#endif import Control.Exception hiding (try) import Control.Monad import Control.Monad.Except diff --git a/hledger-lib/Hledger/Read/JournalReader.hs b/hledger-lib/Hledger/Read/JournalReader.hs index 3ee49b83b..3c50a24d2 100644 --- a/hledger-lib/Hledger/Read/JournalReader.hs +++ b/hledger-lib/Hledger/Read/JournalReader.hs @@ -45,7 +45,9 @@ module Hledger.Read.JournalReader ( #endif ) where -import Control.Applicative ((<*)) +#if !MIN_VERSION_base(4,8,0) +import Control.Applicative.Compat ((<*)) +#endif import qualified Control.Exception as C import Control.Monad import Control.Monad.Except diff --git a/hledger-lib/hledger-lib.cabal b/hledger-lib/hledger-lib.cabal index cb0d03009..d4218942a 100644 --- a/hledger-lib/hledger-lib.cabal +++ b/hledger-lib/hledger-lib.cabal @@ -89,6 +89,7 @@ library Hledger.Utils.UTF8IOCompat build-depends: base >= 4.3 && < 5 + ,base-compat >= 0.5.0 ,array ,blaze-markup >= 0.5.1 ,bytestring @@ -127,6 +128,7 @@ test-suite tests default-language: Haskell2010 build-depends: hledger-lib , base >= 4.3 && < 5 + , base-compat >= 0.5.0 , array , blaze-markup >= 0.5.1 , cmdargs diff --git a/hledger-web/hledger-web.cabal b/hledger-web/hledger-web.cabal index 0f85d6cb5..0931586f5 100644 --- a/hledger-web/hledger-web.cabal +++ b/hledger-web/hledger-web.cabal @@ -162,6 +162,7 @@ library hledger == 0.24.98 , hledger-lib == 0.24.98 , base >= 4 && < 5 + , base-compat >= 0.5.0 , blaze-html , blaze-markup , bytestring @@ -236,6 +237,7 @@ executable hledger-web , hledger == 0.24.98 , hledger-web == 0.24.98 , base >= 4 && < 5 + , base-compat >= 0.5.0 , blaze-html , blaze-markup , bytestring @@ -285,6 +287,7 @@ test-suite test build-depends: hledger-web == 0.24.98 , base + , base-compat >= 0.5.0 , hspec , yesod , yesod-test diff --git a/hledger/Hledger/Cli/Add.hs b/hledger/Hledger/Cli/Add.hs index a25951405..009f57143 100644 --- a/hledger/Hledger/Cli/Add.hs +++ b/hledger/Hledger/Cli/Add.hs @@ -3,12 +3,14 @@ A history-aware add command to help with data entry. |-} {-# OPTIONS_GHC -fno-warn-missing-signatures -fno-warn-unused-do-bind #-} -{-# LANGUAGE ScopedTypeVariables, DeriveDataTypeable, RecordWildCards, TypeOperators, FlexibleContexts #-} +{-# LANGUAGE CPP, ScopedTypeVariables, DeriveDataTypeable, RecordWildCards, TypeOperators, FlexibleContexts #-} module Hledger.Cli.Add where -import Control.Applicative ((<*)) +#if !MIN_VERSION_base(4,8,0) +import Control.Applicative.Compat ((<*)) +#endif import Control.Exception as E import Control.Monad import Control.Monad.Trans (liftIO) diff --git a/hledger/Hledger/Cli/Options.hs b/hledger/Hledger/Cli/Options.hs index dd039dd60..9bd280cbf 100644 --- a/hledger/Hledger/Cli/Options.hs +++ b/hledger/Hledger/Cli/Options.hs @@ -59,7 +59,9 @@ module Hledger.Cli.Options ( ) where -import Control.Applicative ((<$>), (<*)) +#if !MIN_VERSION_base(4,8,0) +import Control.Applicative.Compat ((<$>), (<*)) +#endif import qualified Control.Exception as C import Control.Monad (when) import Data.List diff --git a/hledger/hledger.cabal b/hledger/hledger.cabal index a73688648..5d09234ee 100644 --- a/hledger/hledger.cabal +++ b/hledger/hledger.cabal @@ -77,6 +77,7 @@ library build-depends: hledger-lib == 0.24.98 ,base >= 4.3 && < 5 + ,base-compat >= 0.5.0 -- ,cabal-file-th ,containers ,cmdargs >= 0.10 && < 0.11 @@ -132,6 +133,7 @@ executable hledger hledger-lib == 0.24.98 ,hledger == 0.24.98 ,base >= 4.3 && < 5 + ,base-compat >= 0.5.0 ,containers ,cmdargs >= 0.10 && < 0.11 ,csv @@ -174,6 +176,7 @@ test-suite tests build-depends: hledger-lib , hledger , base >= 4.3 && < 5 + , base-compat >= 0.5.0 , cmdargs , containers , csv @@ -218,6 +221,7 @@ benchmark bench build-depends: hledger-lib, hledger, base >= 4.3 && < 5, + base-compat >= 0.5.0, html, tabular >= 0.2 && < 0.3, process,