Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compatibility with template-haskell up to 2.21 #4

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@
"8.6.1",
"8.8.1",
"8.10.1",
"9.0.1",
"9.2.1",
"9.4.1",
"9.6.1",
"9.8.1"
],
"os": [
"macos-13",
Expand Down
16 changes: 15 additions & 1 deletion Unsafe/TrueName.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
{- }}} -}

decNames :: Dec -> [Name]{- {{{ -}
decNames dec = case dec of

Check warning on line 33 in Unsafe/TrueName.hs

View workflow job for this annotation

GitHub Actions / build (--prefer-oldest, 9.4.1, macos-13)

Pattern match(es) are non-exhaustive

Check warning on line 33 in Unsafe/TrueName.hs

View workflow job for this annotation

GitHub Actions / build (--prefer-oldest, 9.4.1, ubuntu-22.04)

Pattern match(es) are non-exhaustive

Check warning on line 33 in Unsafe/TrueName.hs

View workflow job for this annotation

GitHub Actions / build (--prefer-oldest, 9.6.1, macos-13)

Pattern match(es) are non-exhaustive

Check warning on line 33 in Unsafe/TrueName.hs

View workflow job for this annotation

GitHub Actions / build (--prefer-oldest, 9.6.1, ubuntu-22.04)

Pattern match(es) are non-exhaustive

Check warning on line 33 in Unsafe/TrueName.hs

View workflow job for this annotation

GitHub Actions / build (--prefer-oldest, 9.8.1, macos-13)

Pattern match(es) are non-exhaustive

Check warning on line 33 in Unsafe/TrueName.hs

View workflow job for this annotation

GitHub Actions / build (--prefer-oldest, 9.8.1, ubuntu-22.04)

Pattern match(es) are non-exhaustive

Check warning on line 33 in Unsafe/TrueName.hs

View workflow job for this annotation

GitHub Actions / build (9.4.1, macos-13)

Pattern match(es) are non-exhaustive

Check warning on line 33 in Unsafe/TrueName.hs

View workflow job for this annotation

GitHub Actions / build (9.4.1, ubuntu-22.04)

Pattern match(es) are non-exhaustive

Check warning on line 33 in Unsafe/TrueName.hs

View workflow job for this annotation

GitHub Actions / build (9.4.1, windows-2022)

Pattern match(es) are non-exhaustive

Check warning on line 33 in Unsafe/TrueName.hs

View workflow job for this annotation

GitHub Actions / build (9.6.1, macos-13)

Pattern match(es) are non-exhaustive

Check warning on line 33 in Unsafe/TrueName.hs

View workflow job for this annotation

GitHub Actions / build (9.6.1, ubuntu-22.04)

Pattern match(es) are non-exhaustive

Check warning on line 33 in Unsafe/TrueName.hs

View workflow job for this annotation

GitHub Actions / build (9.6.1, windows-2022)

Pattern match(es) are non-exhaustive

Check warning on line 33 in Unsafe/TrueName.hs

View workflow job for this annotation

GitHub Actions / build (9.8.1, macos-13)

Pattern match(es) are non-exhaustive

Check warning on line 33 in Unsafe/TrueName.hs

View workflow job for this annotation

GitHub Actions / build (9.8.1, ubuntu-22.04)

Pattern match(es) are non-exhaustive

Check warning on line 33 in Unsafe/TrueName.hs

View workflow job for this annotation

GitHub Actions / build (9.8.1, windows-2022)

Pattern match(es) are non-exhaustive
FunD _ _ -> []
ValD _ _ _ -> []
TySynD _ _ typ -> typNames typ
Expand Down Expand Up @@ -196,6 +196,15 @@
#if MIN_VERSION_template_haskell(2,16,0)
ForallVisT _ t -> typNames t
#endif

#if MIN_VERSION_template_haskell(2,17,0)
MulArrowT -> []
#endif

#if MIN_VERSION_template_haskell(2,19,0)
PromotedInfixT s n t -> n : typNames s ++ typNames t
PromotedUInfixT s n t -> n : typNames s ++ typNames t
#endif
{- }}} -}

infoNames :: Info -> [Name]{- {{{ -}
Expand Down Expand Up @@ -347,7 +356,12 @@
_ -> err $ occString occ ++ " has a strange flavour"
makeP (name, vars) = if vars == [".."]
then RecP name . capture VarP <$> recFields name
else return $ ConP name (map pat vars) where
else
#if MIN_VERSION_template_haskell(2,18,0)
return $ ConP name [] (map pat vars) where
#else
return $ ConP name (map pat vars) where
#endif
pat n = case n of
"_" -> WildP
'!' : ns -> BangP (pat ns)
Expand Down
17 changes: 6 additions & 11 deletions true-name.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,8 @@ build-type: Simple
stability: experimental
tested-with:
GHC == 7.10.3,
GHC == 8.0.2,
GHC == 8.2.2,
GHC == 8.4.1,
GHC == 8.6.1,
GHC == 8.8.1,
GHC == 8.10.1
GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.1, GHC == 8.6.1, GHC == 8.8.1, GHC == 8.10.1,
GHC == 9.0.1, GHC == 9.2.1, GHC == 9.4.1, GHC == 9.6.1, GHC == 9.8.1,

source-repository head
type: git
Expand All @@ -36,14 +32,14 @@ source-repository head
common buildenv
default-language: Haskell2010
build-depends:
base ^>=4.8.2 || ^>=4.9.1 || ^>=4.10.1 || ^>=4.11.0 || ^>=4.12.0 || ^>=4.13.0 || ^>=4.14.0,
template-haskell ^>=2.10.0 || ^>=2.11.1 || ^>=2.12.0 || ^>=2.13.0 || ^>=2.14.0 || ^>=2.15.0 || ^>=2.16.0,
base ^>=4.8.2 || ^>=4.9.1 || ^>=4.10.1 || ^>=4.11.0 || ^>=4.12.0 || ^>=4.13.0 || ^>=4.14.0 || ^>=4.15.0 || ^>=4.16.0 || ^>=4.17.0 || ^>=4.18.0 || ^>=4.19.0,
template-haskell ^>=2.10.0 || ^>=2.11.1 || ^>=2.12.0 || ^>=2.13.0 || ^>=2.14.0 || ^>=2.15.0 || ^>=2.16.0 || ^>=2.17.0 || ^>=2.18.0 || ^>=2.19.0 || ^>=2.20.0 || ^>=2.21.0,
ghc-options: -Wall

library
import: buildenv
exposed-modules:
Unsafe.TrueName
ghc-options: -Wall

test-suite sanity
import: buildenv
Expand All @@ -52,9 +48,8 @@ test-suite sanity
main-is: sanity.hs
build-depends:
containers ^>=0.5.6 || ^>=0.6.0,
time ^>=1.1.2 || ^>=1.5.0 || ^>=1.6.0 || ^>=1.8.0 || ^>=1.9,
time ^>=1.1.2 || ^>=1.5.0 || ^>=1.6.0 || ^>=1.8.0 || ^>=1.9 || ^>=1.11.1 || ^>=1.12.2,
true-name,
ghc-options: -Wall

-- vim: et sw=4 ts=4 sts=4: