Skip to content

Commit

Permalink
Support building with template-haskell-2.22.*
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanGlScott committed Mar 14, 2024
1 parent 102f04a commit af425d2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### next [????.??.??]
* Support building with `template-haskell-2.22.*` (GHC 9.10).

### 0.6.5 [2023.08.06]
* When generating `Show(1)(2)` instances with `Text.Show.Deriving` using GHC 9.8
or later, data types that have fields of type `Int{8,16,32,64}#` or
Expand Down
4 changes: 2 additions & 2 deletions deriving-compat.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ library
, semigroups >= 0.6 && < 0.21

if flag(template-haskell-2-11)
build-depends: template-haskell >= 2.11 && < 2.22
build-depends: template-haskell >= 2.11 && < 2.23
, ghc-boot-th
else
build-depends: template-haskell >= 2.5 && < 2.11
Expand Down Expand Up @@ -190,7 +190,7 @@ test-suite spec
, hspec >= 1.8
, QuickCheck >= 2 && < 3
, tagged >= 0.7 && < 1
, template-haskell >= 2.5 && < 2.22
, template-haskell >= 2.5 && < 2.23
, void >= 0.5.10 && < 1
build-tool-depends: hspec-discover:hspec-discover >= 1.8

Expand Down
4 changes: 2 additions & 2 deletions src/Data/Functor/Deriving/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -838,15 +838,15 @@ mkSimpleLam :: (Exp -> Q Exp) -> Q Exp
mkSimpleLam lam = do
n <- newName "n"
body <- lam (VarE n)
return $ LamE [VarP n] body
lamE [varP n] (return body)

-- Make a 'LamE' using two fresh variables.
mkSimpleLam2 :: (Exp -> Exp -> Q Exp) -> Q Exp
mkSimpleLam2 lam = do
n1 <- newName "n1"
n2 <- newName "n2"
body <- lam (VarE n1) (VarE n2)
return $ LamE [VarP n1, VarP n2] body
lamE [varP n1, varP n2] (return body)

-- "Con a1 a2 a3 -> fold [x1 a1, x2 a2, x3 a3]"
--
Expand Down

0 comments on commit af425d2

Please sign in to comment.