From ed0654398149af9dce37c575e44feca41fcaf42e Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sun, 5 Jun 2016 16:16:41 +0200 Subject: [PATCH] Proper GHC conditionals to fix compiler warnings --- hpath.cabal | 5 ++++- src/System/Posix/Directory/Traversals.hs | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/hpath.cabal b/hpath.cabal index c4e7376..54c7dbd 100644 --- a/hpath.cabal +++ b/hpath.cabal @@ -19,7 +19,10 @@ extra-source-files: README.md library hs-source-dirs: src/ default-language: Haskell2010 - ghc-options: -Wall + if impl(ghc >= 8.0) + ghc-options: -Wall -Wno-redundant-constraints + else + ghc-options: -Wall c-sources: cbits/dirutils.c exposed-modules: HPath, HPath.IO, diff --git a/src/System/Posix/Directory/Traversals.hs b/src/System/Posix/Directory/Traversals.hs index ada691e..2b4f37c 100644 --- a/src/System/Posix/Directory/Traversals.hs +++ b/src/System/Posix/Directory/Traversals.hs @@ -10,6 +10,7 @@ -- Traversal and read operations on directories. +{-# LANGUAGE CPP #-} {-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PackageImports #-} @@ -37,7 +38,10 @@ module System.Posix.Directory.Traversals ( , realpath ) where -import Control.Applicative + +#if __GLASGOW_HASKELL__ < 710 +import Control.Applicative ((<$>)) +#endif import Control.Monad import System.Posix.FilePath (()) import System.Posix.Directory.Foreign