From b4f8e009213e88e148da497c66453bc3760cc59c Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Fri, 3 Apr 2015 02:02:44 +0200 Subject: Fix ghc 7.4 --- Distribution/Helper.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Distribution') diff --git a/Distribution/Helper.hs b/Distribution/Helper.hs index b06ffe4..1a4bc37 100644 --- a/Distribution/Helper.hs +++ b/Distribution/Helper.hs @@ -57,6 +57,7 @@ import Control.Monad.IO.Class import Control.Monad.State.Strict import Control.Monad.Reader import Control.Exception as E +import Data.Char import Data.Monoid import Data.List import Data.Default @@ -211,6 +212,10 @@ buildPlatform :: IO String buildPlatform = do exe <- findLibexecExe "cabal-helper-wrapper" dropWhileEnd isSpace <$> readProcess exe ["print-build-platform"] "" + where + -- dropWhileEnd is not provided prior to base 4.5.0.0. + dropWhileEnd :: (a -> Bool) -> [a] -> [a] + dropWhileEnd p = foldr (\x xs -> if p x && null xs then [] else x : xs) [] -- | This exception is thrown by all 'runQuery' functions if the internal -- wrapper executable cannot be found. You may catch this and present the user -- cgit v1.2.3