Skip to content
Closed
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
11 changes: 6 additions & 5 deletions extensions.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,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 +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
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