Skip to content

Commit

Permalink
Support GHC 9.10. (#49)
Browse files Browse the repository at this point in the history
Fixes #48.
  • Loading branch information
athas authored May 16, 2024
1 parent 0b924b8 commit e622a88
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
3 changes: 3 additions & 0 deletions haskell-src-meta/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
0.8.14
- Support for GHC 9.10 (by Troels Henriksen)

0.8.13
- Support for GHC 9.8 (by Vladislav Zavialov)

Expand Down
4 changes: 2 additions & 2 deletions haskell-src-meta/haskell-src-meta.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ author: Matt Morrow
copyright: (c) Matt Morrow
maintainer: [email protected]
bug-reports: https://github.com/haskell-party/haskell-src-meta/issues
tested-with: GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.2, GHC == 9.4.1, GHC == 9.6.1, GHC == 9.8.1
tested-with: GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.2, GHC == 9.4.1, GHC == 9.6.1, GHC == 9.8.1, GHC == 9.10.1
synopsis: Parse source to template-haskell abstract syntax.
description: The translation from haskell-src-exts abstract syntax
to template-haskell abstract syntax isn't 100% complete yet.
Expand All @@ -22,7 +22,7 @@ library
haskell-src-exts >= 1.21 && < 1.24,
pretty >= 1.0 && < 1.2,
syb >= 0.1 && < 0.8,
template-haskell >= 2.12 && < 2.22,
template-haskell >= 2.12 && < 2.23,
th-orphans >= 0.12 && < 0.14

hs-source-dirs: src
Expand Down
7 changes: 7 additions & 0 deletions haskell-src-meta/src/Language/Haskell/Meta/Extensions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,13 @@ fromExtension e = case e of
TH.ExtendedLiterals -> Nothing
#endif

-- 2.22.0 ---------------------------------------

#if MIN_VERSION_template_haskell(2,22,0)
TH.RequiredTypeArguments -> Nothing
TH.ListTuplePuns -> Nothing
#endif

-- NB: when adding a case here, you may also need to update `toExtension`


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,11 @@ instance ToDecs (Exts.Decl l) where
toDecs (Exts.InfixDecl l assoc Nothing ops) =
toDecs (Exts.InfixDecl l assoc (Just 9) ops)
toDecs (Exts.InfixDecl _ assoc (Just fixity) ops) =
#if MIN_VERSION_template_haskell(2,22,0)
map (\op -> TH.InfixD (TH.Fixity fixity dir) TH.NoNamespaceSpecifier (toName op)) ops
#else
map (\op -> TH.InfixD (TH.Fixity fixity dir) (toName op)) ops
#endif
where
dir = case assoc of
Exts.AssocNone _ -> TH.InfixN
Expand Down

0 comments on commit e622a88

Please sign in to comment.