diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c28269..50863d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,8 @@ jobs: - "9.0.2" - "9.2.4" - "9.4.2" + - "9.6.3" + - "9.8.1" steps: - uses: actions/checkout@v3 diff --git a/extensions.cabal b/extensions.cabal index 039adf0..e1064a5 100644 --- a/extensions.cabal +++ b/extensions.cabal @@ -31,7 +31,7 @@ source-repository head location: https://github.com/kowainik/extensions.git common common-options - build-depends: base >= 4.13.0.0 && < 4.18 + build-depends: base >= 4.13.0.0 && < 4.20 ghc-options: -Wall -Wcompat @@ -81,14 +81,14 @@ library Extensions.Package Extensions.Types - build-depends: bytestring >= 0.10 && < 0.12 - , Cabal >= 3.0 && < 3.9 + build-depends: bytestring >= 0.10 && < 0.13 + , Cabal ^>= 3.10 , containers ^>= 0.6 , directory ^>= 1.3 , filepath ^>= 1.4 - , ghc-boot-th >= 8.8.1 && < 9.5 + , ghc-boot-th >= 8.8.1 && < 9.9 , parsec ^>= 3.1 - , text >= 1.2.3 && < 2.1 + , text >= 1.2.3 && < 2.2 executable extensions import: common-options diff --git a/src/Extensions/Cabal.hs b/src/Extensions/Cabal.hs index dd35abf..824a528 100644 --- a/src/Extensions/Cabal.hs +++ b/src/Extensions/Cabal.hs @@ -351,22 +351,55 @@ toGhcExtension = \case Cabal.ImportQualifiedPost -> Just ImportQualifiedPost Cabal.StandaloneKindSignatures -> Just StandaloneKindSignatures Cabal.UnliftedNewtypes -> Just UnliftedNewtypes +#else + Cabal.CUSKs -> Nothing + Cabal.ImportQualifiedPost -> Nothing + Cabal.StandaloneKindSignatures -> Nothing + Cabal.UnliftedNewtypes -> Nothing #endif #if __GLASGOW_HASKELL__ >= 900 Cabal.LexicalNegation -> Just LexicalNegation Cabal.QualifiedDo -> Just QualifiedDo Cabal.LinearTypes -> Just LinearTypes +#else + Cabal.LexicalNegation -> Nothing + Cabal.QualifiedDo -> Nothing + Cabal.LinearTypes -> Nothing #endif #if __GLASGOW_HASKELL__ >= 902 Cabal.FieldSelectors -> Just FieldSelectors Cabal.OverloadedRecordDot -> Just OverloadedRecordDot Cabal.UnliftedDatatypes -> Just UnliftedDatatypes +#else + Cabal.FieldSelectors -> Nothing + Cabal.OverloadedRecordDot -> Nothing + Cabal.UnliftedDatatypes -> Nothing #endif #if __GLASGOW_HASKELL__ >= 904 Cabal.OverloadedRecordUpdate -> Just OverloadedRecordUpdate Cabal.AlternativeLayoutRule -> Just AlternativeLayoutRule Cabal.AlternativeLayoutRuleTransitional -> Just AlternativeLayoutRuleTransitional Cabal.RelaxedLayout -> Just RelaxedLayout +#else + Cabal.OverloadedRecordUpdate -> Nothing + Cabal.AlternativeLayoutRule -> Nothing + Cabal.AlternativeLayoutRuleTransitional -> Nothing + Cabal.RelaxedLayout -> Nothing +#endif +#if __GLASGOW_HASKELL__ >= 906 + Cabal.DeepSubsumption -> Just DeepSubsumption + Cabal.TypeData -> Just TypeData +#else + Cabal.DeepSubsumption -> Nothing + Cabal.TypeData -> Nothing +#endif +#if __GLASGOW_HASKELL__ >= 910 + -- This branch cannot be satisfied yet but we're including it so + -- we don't forget to enablel RequiredTypeArguments when it + -- becomes available. + Cabal.RequiredTypeArguments -> Just RequiredTypeArguments +#else + Cabal.RequiredTypeArguments -> Nothing #endif -- GHC extensions, parsed by both Cabal and GHC, but don't have an Extension constructor Cabal.Safe -> Nothing