Skip to content

Commit

Permalink
compatibility with template-haskell-2.21.0 and ghc 9.8
Browse files Browse the repository at this point in the history
  • Loading branch information
locallycompact committed Oct 16, 2023
1 parent 55aff09 commit d5e6455
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions dhall-bash/dhall-bash.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions dhall/dhall.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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 ,
Expand All @@ -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 ,
Expand Down
5 changes: 5 additions & 0 deletions dhall/src/Dhall/Syntax/Instances/Lift.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveLift #-}
{-# LANGUAGE StandaloneDeriving #-}

Expand All @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion dhall/src/Dhall/TH.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit d5e6455

Please sign in to comment.