From d9ba67b6f04d24c6f3c49154095d37cb57f82c6b Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Thu, 12 Apr 2018 01:41:32 +0200 Subject: [PATCH] Fix build with ghc-7.6 --- src/HPath.hs | 6 ++++++ src/HPath/IO.hs | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/HPath.hs b/src/HPath.hs index 9e5f2ac..f6369ea 100644 --- a/src/HPath.hs +++ b/src/HPath.hs @@ -13,7 +13,9 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE EmptyDataDecls #-} +#if __GLASGOW_HASKELL__ >= 708 {-# LANGUAGE PatternSynonyms #-} +#endif module HPath ( @@ -25,8 +27,10 @@ module HPath ,PathParseException ,PathException ,RelC +#if __GLASGOW_HASKELL__ >= 708 -- * PatternSynonyms/ViewPatterns ,pattern Path +#endif -- * Path Parsing ,parseAbs ,parseFn @@ -101,7 +105,9 @@ instance RelC Fn #if __GLASGOW_HASKELL__ >= 710 pattern Path :: ByteString -> Path a #endif +#if __GLASGOW_HASKELL__ >= 708 pattern Path x <- (MkPath x) +#endif -------------------------------------------------------------------------------- -- Path Parsers diff --git a/src/HPath/IO.hs b/src/HPath/IO.hs index 9692561..3c3dc1d 100644 --- a/src/HPath/IO.hs +++ b/src/HPath/IO.hs @@ -33,6 +33,7 @@ -- For other functions (like `copyFile`), the behavior on these file types is -- unreliable/unsafe. Check the documentation of those functions for details. +{-# LANGUAGE CPP #-} {-# LANGUAGE PackageImports #-} {-# LANGUAGE OverloadedStrings #-} @@ -107,7 +108,11 @@ import Data.ByteString ( ByteString ) +#if MIN_VERSION_bytestring(0,10,2) import Data.ByteString.Builder +#else +import Data.ByteString.Lazy.Builder +#endif ( Builder , byteString