diff --git a/hledger-lib/Hledger/Utils/Debug.hs b/hledger-lib/Hledger/Utils/Debug.hs index 24b11b0ba..27ca08f67 100644 --- a/hledger-lib/Hledger/Utils/Debug.hs +++ b/hledger-lib/Hledger/Utils/Debug.hs @@ -10,9 +10,7 @@ module Hledger.Utils.Debug ( module Hledger.Utils.Debug ,module Debug.Trace -#if __GLASGOW_HASKELL__ >= 704 ,ppShow -#endif ) where @@ -28,14 +26,7 @@ import System.Exit import System.IO.Unsafe (unsafePerformIO) import Text.Megaparsec import Text.Printf - -#if __GLASGOW_HASKELL__ >= 704 import Text.Show.Pretty (ppShow) -#else --- the required pretty-show version requires GHC >= 7.4 -ppShow :: Show a => a -> String -ppShow = show -#endif pprint :: Show a => a -> IO () pprint = putStrLn . ppShow diff --git a/hledger-lib/Hledger/Utils/UTF8IOCompat.hs b/hledger-lib/Hledger/Utils/UTF8IOCompat.hs index d1f28820d..61ec5c95e 100644 --- a/hledger-lib/Hledger/Utils/UTF8IOCompat.hs +++ b/hledger-lib/Hledger/Utils/UTF8IOCompat.hs @@ -44,10 +44,6 @@ where -- import qualified Data.ByteString.Lazy.UTF8 as U8 (toString, fromString) import Prelude hiding (readFile, writeFile, appendFile, getContents, putStr, putStrLn) import System.IO -- (Handle) --- #if __GLASGOW_HASKELL__ < 702 --- import Codec.Binary.UTF8.String as UTF8 (decodeString, encodeString, isUTF8Encoded) --- import System.Info (os) --- #endif -- bom :: B.ByteString -- bom = B.pack [0xEF, 0xBB, 0xBF] @@ -100,24 +96,12 @@ type SystemString = String -- | Convert a system string to an ordinary string, decoding from UTF-8 if -- it appears to be UTF8-encoded and GHC version is less than 7.2. fromSystemString :: SystemString -> String --- #if __GLASGOW_HASKELL__ < 702 --- fromSystemString s = if UTF8.isUTF8Encoded s then UTF8.decodeString s else s --- #else fromSystemString = id --- #endif -- | Convert a unicode string to a system string, encoding with UTF-8 if -- we are on a posix platform with GHC < 7.2. toSystemString :: String -> SystemString --- #if __GLASGOW_HASKELL__ < 702 --- toSystemString = case os of --- "unix" -> UTF8.encodeString --- "linux" -> UTF8.encodeString --- "darwin" -> UTF8.encodeString --- _ -> id --- #else toSystemString = id --- #endif -- | A SystemString-aware version of error. error' :: String -> a diff --git a/hledger-web/Import.hs b/hledger-web/Import.hs index d3234190b..87c66bb3b 100644 --- a/hledger-web/Import.hs +++ b/hledger-web/Import.hs @@ -17,17 +17,4 @@ import Settings as Import import Settings.Development as Import import Settings.StaticFiles as Import -#if __GLASGOW_HASKELL__ >= 704 -import Data.Monoid as Import ( -#if !MIN_VERSION_base(4,8,0) - Monoid (mappend, mempty, mconcat), -#endif - (<>)) -#else -import Data.Monoid as Import - (Monoid (mappend, mempty, mconcat)) - -infixr 5 <> -(<>) :: Monoid m => m -> m -> m -(<>) = mappend -#endif +import Data.Monoid as Import ((<>))