Skip to content
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- "9.0.2"
- "9.2.4"
- "9.4.2"
- "9.6.3"

steps:
- uses: actions/checkout@v3
Expand Down
23 changes: 17 additions & 6 deletions extensions.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ tested-with: GHC == 8.8.4
GHC == 9.0.2
GHC == 9.2.4
GHC == 9.4.2
GHC == 9.6.3

flag executable
description: Build the extensions executable
Expand All @@ -31,13 +32,14 @@ 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
-Widentities
-Wincomplete-uni-patterns
-Wincomplete-record-updates
-Werror=incomplete-patterns
if impl(ghc >= 8.0)
ghc-options: -Wredundant-constraints
if impl(ghc >= 8.2)
Expand Down Expand Up @@ -80,14 +82,23 @@ library
Extensions.Package
Extensions.Types

build-depends: bytestring >= 0.10 && < 0.12
, Cabal >= 3.0 && < 3.9
build-depends: bytestring >= 0.10 && < 0.13
-- We need to pin a single major version of
-- Cabal here because the main reason we use
-- Cabal is for its list of extensions. Later
-- versions have strictly more extensions, and
-- we'll have missing patterns if we try to
-- support more than one major version. If
-- this causes problems in practice let's
-- revisit this decision and come up with
-- another approach.
, Cabal ^>= 3.10
Comment on lines +85 to +95
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spinned off a discussion in #111.

This hit me when trying to package extensions @ the latest for ArchLinux which is still on GHC 9.4.8 (unfortunately). I had to pin the package to 0.1.0.0.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, is there anything I need to do to support you, or is this just for information, like #111?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just informational, thanks 🙏

, 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
Expand Down Expand Up @@ -118,7 +129,7 @@ test-suite extensions-test
, bytestring
, containers
, ghc-boot-th
, hedgehog >= 1.0 && < 1.3
, hedgehog >= 1.0 && < 1.5
, hspec
, hspec-hedgehog ^>= 0.0.1
, text
Expand Down
33 changes: 33 additions & 0 deletions src/Extensions/Cabal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down