From 8ed7d765dd907c1a0c78f277eb2349b76f10c02d Mon Sep 17 00:00:00 2001 From: Simon Jakobi Date: Mon, 21 Oct 2019 23:44:09 +0200 Subject: [PATCH] Require base >= 4.11 There were multiple build failures with GHC-8.2 due to (<>) and Semigroup not being in scope. --- hnix.cabal | 6 +++--- src/Nix/Cache.hs | 2 +- src/Nix/Expr/Types.hs | 17 ----------------- 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/hnix.cabal b/hnix.cabal index fa68d10..b855dd0 100644 --- a/hnix.cabal +++ b/hnix.cabal @@ -489,7 +489,7 @@ library build-depends: aeson >= 1.4.2 && < 1.5 , array >=0.4 && <0.6 - , base >=4.9 && <5 + , base >=4.11 && <5 , binary >= 0.8.5 && < 0.9 , bytestring >= 0.10.8 && < 0.11 , comonad >= 5.0.4 && < 5.1 @@ -644,7 +644,7 @@ test-suite hnix-tests build-depends: Diff , Glob - , base >=4.9 && <5 + , base >=4.11 && <5 , bytestring , containers , data-fix @@ -705,7 +705,7 @@ benchmark hnix-benchmarks benchmarks ghc-options: -Wall build-depends: - base >=4.9 && <5 + base >=4.11 && <5 , bytestring , containers , criterion diff --git a/src/Nix/Cache.hs b/src/Nix/Cache.hs index 19e1dae..114ccb7 100644 --- a/src/Nix/Cache.hs +++ b/src/Nix/Cache.hs @@ -5,7 +5,7 @@ module Nix.Cache where import qualified Data.ByteString.Lazy as BS import Nix.Expr.Types.Annotated -#if defined (__linux__) && MIN_VERSION_base(4, 10, 0) +#if defined (__linux__) #define USE_COMPACT 1 #endif diff --git a/src/Nix/Expr/Types.hs b/src/Nix/Expr/Types.hs index 146cf0c..15463e8 100644 --- a/src/Nix/Expr/Types.hs +++ b/src/Nix/Expr/Types.hs @@ -68,10 +68,8 @@ import Nix.Utils import Text.Megaparsec.Pos import Text.Read.Deriving import Text.Show.Deriving -#if MIN_VERSION_base(4, 10, 0) import Type.Reflection ( eqTypeRep ) import qualified Type.Reflection as Reflection -#endif type VarName = Text @@ -83,14 +81,6 @@ hashAt = flip alterF instance Hashable1 NonEmpty #endif -#if !MIN_VERSION_base(4, 10, 0) -instance Eq1 NonEmpty where - liftEq eq (a NE.:| as) (b NE.:| bs) = eq a b && liftEq eq as bs -instance Show1 NonEmpty where - liftShowsPrec shwP shwL p (a NE.:| as) = showParen (p > 5) $ - shwP 6 a . showString " :| " . shwL as -#endif - #if !MIN_VERSION_binary(0, 8, 4) instance Binary a => Binary (NE.NonEmpty a) where get = fmap NE.fromList Bin.get @@ -162,18 +152,11 @@ instance Serialise r => Serialise (NExprF r) instance IsString NExpr where fromString = Fix . NSym . fromString -#if MIN_VERSION_base(4, 10, 0) instance Lift (Fix NExprF) where lift = dataToExpQ $ \b -> case Reflection.typeOf b `eqTypeRep` Reflection.typeRep @Text of Just HRefl -> Just [| pack $(liftString $ unpack b) |] Nothing -> Nothing -#else -instance Lift (Fix NExprF) where - lift = dataToExpQ $ \b -> case cast b of - Just t -> Just [| pack $(liftString $ unpack t) |] - Nothing -> Nothing -#endif -- | The monomorphic expression type is a fixed point of the polymorphic one. type NExpr = Fix NExprF