diff --git a/hledger-web/Foundation.hs b/hledger-web/Foundation.hs index f5498ae0d..3fd608a99 100644 --- a/hledger-web/Foundation.hs +++ b/hledger-web/Foundation.hs @@ -8,7 +8,9 @@ See a default Yesod app's comments for more details of each part. module Foundation where import Prelude +#if !MIN_VERSION_base(4,8,0) import Control.Applicative ((<$>)) +#endif import Data.IORef import Yesod import Yesod.Static diff --git a/hledger-web/Handler/AddForm.hs b/hledger-web/Handler/AddForm.hs index c64e10a7e..7afe95bbf 100644 --- a/hledger-web/Handler/AddForm.hs +++ b/hledger-web/Handler/AddForm.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE FlexibleContexts, OverloadedStrings, QuasiQuotes, RecordWildCards #-} +{-# LANGUAGE CPP, FlexibleContexts, OverloadedStrings, QuasiQuotes, RecordWildCards #-} -- | Add form data & handler. (The layout and js are defined in -- Foundation so that the add form can be in the default layout for -- all views.) @@ -7,7 +7,9 @@ module Handler.AddForm where import Import +#if !MIN_VERSION_base(4,8,0) import Control.Applicative +#endif import Data.Either (lefts,rights) import Data.List (sort) import qualified Data.List as L (head) -- qualified keeps dev & prod builds warning-free diff --git a/hledger-web/Hledger/Web/Main.hs b/hledger-web/Hledger/Web/Main.hs index 222e0c893..c1065b5fd 100644 --- a/hledger-web/Hledger/Web/Main.hs +++ b/hledger-web/Hledger/Web/Main.hs @@ -20,7 +20,9 @@ import Network.Wai.Handler.Warp (runSettings, defaultSettings, setPort) import Network.Wai.Handler.Launch (runUrlPort) -- import Prelude hiding (putStrLn) +#if !MIN_VERSION_base(4,8,0) import Control.Applicative ((<$>)) +#endif import Control.Monad (when) import Data.Text (pack) import System.Exit (exitSuccess) diff --git a/hledger-web/Hledger/Web/Options.hs b/hledger-web/Hledger/Web/Options.hs index 8727f217e..57d897b26 100644 --- a/hledger-web/Hledger/Web/Options.hs +++ b/hledger-web/Hledger/Web/Options.hs @@ -2,7 +2,9 @@ module Hledger.Web.Options where import Prelude +#if !MIN_VERSION_base(4,8,0) import Control.Applicative ((<$>)) +#endif import Data.Maybe import System.Console.CmdArgs import System.Console.CmdArgs.Explicit diff --git a/hledger-web/Import.hs b/hledger-web/Import.hs index 3496f6261..d3234190b 100644 --- a/hledger-web/Import.hs +++ b/hledger-web/Import.hs @@ -7,7 +7,9 @@ import Prelude as Import hiding (head, init, last, readFile, tail, writeFile) import Yesod as Import hiding (Route (..)) +#if !MIN_VERSION_base(4,8,0) import Control.Applicative as Import (pure, (<$>), (<*>)) +#endif import Data.Text as Import (Text) import Foundation as Import @@ -16,8 +18,10 @@ import Settings.Development as Import import Settings.StaticFiles as Import #if __GLASGOW_HASKELL__ >= 704 -import Data.Monoid as Import - (Monoid (mappend, mempty, mconcat), +import Data.Monoid as Import ( +#if !MIN_VERSION_base(4,8,0) + Monoid (mappend, mempty, mconcat), +#endif (<>)) #else import Data.Monoid as Import diff --git a/hledger-web/Settings.hs b/hledger-web/Settings.hs index 98bd53b92..3c147dc29 100644 --- a/hledger-web/Settings.hs +++ b/hledger-web/Settings.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE OverloadedStrings, QuasiQuotes #-} +{-# LANGUAGE CPP, OverloadedStrings, QuasiQuotes #-} -- | Settings are centralized, as much as possible, into this file. This -- includes database connection settings, static file locations, etc. -- In addition, you can configure a number of different aspects of Yesod @@ -13,7 +13,9 @@ import Yesod.Default.Config import Yesod.Default.Util import Data.Text (Text) import Data.Yaml +#if !MIN_VERSION_base(4,8,0) import Control.Applicative +#endif import Settings.Development import Data.Default (def) import Text.Hamlet