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 6608349 commit 81c24ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.markdown
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).

6 [unreleased]
--------------
* Invert dependency on `distributive`.
Expand Down
6 changes: 2 additions & 4 deletions src/Data/Bifunctor/TH.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1200,8 +1200,7 @@ mkSimpleLam lam = do
--
-- Without the underscore, that code would trigger -Wunused-matches warnings.
n <- newName "_n"
body <- lam (VarE n)
return $ LamE [VarP n] body
lamE [varP n] $ lam (VarE n)

-- Make a 'LamE' using two fresh variables.
mkSimpleLam2 :: (Exp -> Exp -> Q Exp) -> Q Exp
Expand All @@ -1216,8 +1215,7 @@ mkSimpleLam2 lam = do
-- Without the underscore, that code would trigger -Wunused-matches warnings.
n1 <- newName "_n1"
n2 <- newName "n2"
body <- lam (VarE n1) (VarE n2)
return $ LamE [VarP n1, VarP n2] body
lamE [varP n1, varP n2] $ lam (VarE n1) (VarE n2)

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

0 comments on commit 81c24ba

Please sign in to comment.