Fix build with GHC 7.10

This commit is contained in:
Bryan O'Sullivan 2015-01-20 15:31:31 -08:00
parent 3404f214ac
commit 686e4fd75e
1 changed files with 9 additions and 6 deletions

View File

@ -1,4 +1,4 @@
{-# LANGUAGE GeneralizedNewtypeDeriving, ScopedTypeVariables #-} {-# LANGUAGE CPP, GeneralizedNewtypeDeriving, ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# OPTIONS_GHC -fno-warn-orphans #-}
-- | -- |
@ -115,6 +115,9 @@ module System.FilePath.Find (
, (||?) , (||?)
) where ) where
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative (Applicative)
#endif
import qualified Control.Exception as E import qualified Control.Exception as E
import Control.Exception (IOException, handle) import Control.Exception (IOException, handle)
import Control.Monad (foldM, forM, liftM, liftM2) import Control.Monad (foldM, forM, liftM, liftM2)
@ -151,7 +154,7 @@ mkFI = FileInfo
-- construction of combinators. Wraps the 'State' monad, but doesn't -- construction of combinators. Wraps the 'State' monad, but doesn't
-- allow 'get' or 'put'. -- allow 'get' or 'put'.
newtype FindClause a = FC { runFC :: State FileInfo a } newtype FindClause a = FC { runFC :: State FileInfo a }
deriving (Functor, Monad) deriving (Functor, Applicative, Monad)
-- | Run the given 'FindClause' on the given 'FileInfo' and return its -- | Run the given 'FindClause' on the given 'FileInfo' and return its
-- result. This can be useful if you are writing a function to pass -- result. This can be useful if you are writing a function to pass
@ -295,7 +298,7 @@ fold :: RecursionPredicate
-> IO a -> IO a
fold = foldWithHandler warnOnError fold = foldWithHandler warnOnError
where warnOnError path a err = where warnOnError path a err =
hPutStrLn stderr (path ++ ": " ++ show err) >> return a hPutStrLn stderr (path ++ ": " ++ show err) >> return a
-- | Unconditionally return 'True'. -- | Unconditionally return 'True'.
@ -423,7 +426,7 @@ statusType st | F.isSocket st = Socket
statusType _ = Unknown statusType _ = Unknown
-- $statusFunctions -- $statusFunctions
-- --
-- These are simply lifted versions of the 'F.FileStatus' accessor -- These are simply lifted versions of the 'F.FileStatus' accessor
-- functions in the "System.Posix.Files" module. The definitions all -- functions in the "System.Posix.Files" module. The definitions all
-- have the following form: -- have the following form:
@ -501,12 +504,12 @@ liftOp :: Monad m => (a -> b -> c) -> m a -> b -> m c
liftOp f a b = a >>= \a' -> return (f a' b) liftOp f a b = a >>= \a' -> return (f a' b)
-- $binaryOperators -- $binaryOperators
-- --
-- These are lifted versions of the most commonly used binary -- These are lifted versions of the most commonly used binary
-- operators. They have the same fixities and associativities as -- operators. They have the same fixities and associativities as
-- their unlifted counterparts. They are lifted using 'liftOp', like -- their unlifted counterparts. They are lifted using 'liftOp', like
-- so: -- so:
-- --
-- @('==?') = 'liftOp' (==)@ -- @('==?') = 'liftOp' (==)@
-- | Return 'True' if the current file's name matches the given -- | Return 'True' if the current file's name matches the given