From d5e6455237022dad5863733ff76341aa5d340e6f Mon Sep 17 00:00:00 2001 From: Daniel Firth Date: Tue, 28 Mar 2023 07:56:32 +0000 Subject: [PATCH] compatibility with template-haskell-2.21.0 and ghc 9.8 --- dhall-bash/dhall-bash.cabal | 4 ++-- dhall/dhall.cabal | 10 +++++----- dhall/src/Dhall/Syntax/Instances/Lift.hs | 5 +++++ dhall/src/Dhall/TH.hs | 4 +++- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/dhall-bash/dhall-bash.cabal b/dhall-bash/dhall-bash.cabal index 0f59b66be..4ee8f62f7 100644 --- a/dhall-bash/dhall-bash.cabal +++ b/dhall-bash/dhall-bash.cabal @@ -28,12 +28,12 @@ Library Hs-Source-Dirs: src Build-Depends: base >= 4.11.0.0 && < 5 , - bytestring < 0.12, + bytestring < 0.13, containers < 0.7 , dhall >= 1.42.0 && < 1.43, neat-interpolation < 0.6 , shell-escape < 0.3 , - text >= 0.2 && < 2.1 + text >= 0.2 && < 2.2 Exposed-Modules: Dhall.Bash GHC-Options: -Wall Default-Language: Haskell2010 diff --git a/dhall/dhall.cabal b/dhall/dhall.cabal index f36fb2682..16ca7cb06 100644 --- a/dhall/dhall.cabal +++ b/dhall/dhall.cabal @@ -205,19 +205,19 @@ Flag network-tests Common common Build-Depends: base >= 4.11.0.0 && < 5 , - aeson >= 1.0.0.0 && < 2.2 , + aeson >= 1.0.0.0 && < 2.3 , aeson-pretty < 0.9 , ansi-terminal >= 0.6.3.1 && < 1.1 , atomic-write >= 0.2.0.7 && < 0.3 , base16-bytestring >= 1.0.0.0 , - bytestring < 0.12, + bytestring < 0.13, case-insensitive < 1.3 , cborg >= 0.2.0.0 && < 0.3 , cborg-json >= 0.2.2.0 && < 0.3 , containers >= 0.5.8.0 && < 0.7 , contravariant < 1.6 , data-fix < 0.4 , - deepseq < 1.5 , + deepseq < 1.6 , Diff >= 0.2 && < 0.5 , directory >= 1.3.0.0 && < 1.4 , dotgen >= 0.4.2 && < 0.5 , @@ -244,8 +244,8 @@ Common common repline >= 0.4.0.0 && < 0.5 , serialise >= 0.2.0.0 && < 0.3 , scientific >= 0.3.0.0 && < 0.4 , - template-haskell >= 2.13.0.0 && < 2.20, - text >= 0.11.1.0 && < 2.1 , + template-haskell >= 2.13.0.0 && < 2.22, + text >= 0.11.1.0 && < 2.2 , text-manipulate >= 0.2.0.1 && < 0.4 , text-short >= 0.1 && < 0.2 , th-lift-instances >= 0.1.13 && < 0.2 , diff --git a/dhall/src/Dhall/Syntax/Instances/Lift.hs b/dhall/src/Dhall/Syntax/Instances/Lift.hs index 50a0bd163..c19050a96 100644 --- a/dhall/src/Dhall/Syntax/Instances/Lift.hs +++ b/dhall/src/Dhall/Syntax/Instances/Lift.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveLift #-} {-# LANGUAGE StandaloneDeriving #-} @@ -15,13 +16,17 @@ import Dhall.Syntax.Types import Dhall.Syntax.Var import Language.Haskell.TH.Syntax (Lift) +#if !MIN_VERSION_template_haskell(2,21,0) import qualified Data.Fixed as Fixed +#endif import qualified Data.Time as Time deriving instance Lift Time.Day deriving instance Lift Time.TimeOfDay deriving instance Lift Time.TimeZone +#if !MIN_VERSION_template_haskell(2,21,0) deriving instance Lift (Fixed.Fixed a) +#endif deriving instance Lift Const deriving instance Lift Var deriving instance (Lift s, Lift a) => Lift (Binding s a) diff --git a/dhall/src/Dhall/TH.hs b/dhall/src/Dhall/TH.hs index 203ec662f..f1b1ffd79 100644 --- a/dhall/src/Dhall/TH.hs +++ b/dhall/src/Dhall/TH.hs @@ -264,7 +264,9 @@ toDeclaration generateOptions@GenerateOptions{..} haskellTypes typ = interpretOptions = generateToInterpretOptions generateOptions typ -#if MIN_VERSION_template_haskell(2,17,0) +#if MIN_VERSION_template_haskell(2,21,0) + toTypeVar (V n i) = Syntax.PlainTV (Syntax.mkName (Text.unpack n ++ show i)) Syntax.BndrInvis +#elif MIN_VERSION_template_haskell(2,17,0) toTypeVar (V n i) = Syntax.PlainTV (Syntax.mkName (Text.unpack n ++ show i)) () #else toTypeVar (V n i) = Syntax.PlainTV (Syntax.mkName (Text.unpack n ++ show i))