Skip to content

Commit 70f7f96

Browse files
committed
Run ghc-supported-extensions on CI
1 parent 5fe8d8d commit 70f7f96

3 files changed

Lines changed: 293 additions & 14 deletions

File tree

.github/workflows/validate.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ jobs:
262262
# one possibly nightmarish final conditional. 'fail-fast' gets us
263263
# partway there, at least, but is still imperfect.
264264

265+
- name: Check that language extensions are registered for this GHC version
266+
run: cabal run ghc-supported-extensions ghc
267+
265268
validate-old-ghcs:
266269
name: Validate old ghcs ${{ matrix.extra-ghc }}
267270
# latest/latest doesn't have the old packages the old ghcs depend on

Cabal-tests/exes/GhcSupportedExtensions.hs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import Distribution.Text (display, simpleParse)
1111
import Distribution.Verbosity (Verbosity (..), defaultVerbosityHandles, normal)
1212
import Language.Haskell.Extension (Extension (..), knownLanguages)
1313

14-
import Data.List ((\\))
1514
import System.Environment (getArgs, getProgName)
1615

1716
-- | Language editions as Extensions.
@@ -61,11 +60,8 @@ checkProblems implemented =
6160
-- Extensions that ghc knows about but that are not registered except for the known languages.
6261
let unregistered = [ext | ext <- implemented, not (registered ext), ext `notElem` langsAsExts]
6362

64-
-- check if someone has forgotten to update the `langsAsExts` exceptions list...
65-
badExceptions = langsAsExts \\ implemented
66-
6763
-- exceptions that are now registered
68-
badExceptions' = filter registered langsAsExts
64+
badExceptions = filter registered langsAsExts
6965
in catMaybes
7066
[ check unregistered $
7167
unlines
@@ -75,19 +71,11 @@ checkProblems implemented =
7571
, "All extensions should be registered, even experimental extensions."
7672
]
7773
, check badExceptions $
78-
unlines
79-
[ "Error in the extension exception list. The following extensions"
80-
, "are listed as exceptions but are not even implemented by GHC:"
81-
, " " ++ intercalate "\n " (map display badExceptions)
82-
, "Please fix this test program by correcting the list of"
83-
, "exceptions."
84-
]
85-
, check badExceptions' $
8674
unlines
8775
[ "Error in the extension exception list. The following extensions"
8876
, "are listed as exceptions to registration but they are in fact"
8977
, "now registered in Language.Haskell.Extension:"
90-
, " " ++ intercalate "\n " (map display badExceptions')
78+
, " " ++ intercalate "\n " (map display badExceptions)
9179
, "Please fix this test program by correcting the list of"
9280
, "exceptions."
9381
]

foo

Lines changed: 288 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,288 @@
1+
Haskell98
2+
Haskell2010
3+
GHC2021
4+
GHC2024
5+
Unsafe
6+
Trustworthy
7+
Safe
8+
CPP
9+
NoCPP
10+
OverlappingInstances
11+
NoOverlappingInstances
12+
UndecidableInstances
13+
NoUndecidableInstances
14+
IncoherentInstances
15+
NoIncoherentInstances
16+
UndecidableSuperClasses
17+
NoUndecidableSuperClasses
18+
MonomorphismRestriction
19+
NoMonomorphismRestriction
20+
MonoLocalBinds
21+
NoMonoLocalBinds
22+
DeepSubsumption
23+
NoDeepSubsumption
24+
RelaxedPolyRec
25+
NoRelaxedPolyRec
26+
ExtendedDefaultRules
27+
NoExtendedDefaultRules
28+
NamedDefaults
29+
NoNamedDefaults
30+
ForeignFunctionInterface
31+
NoForeignFunctionInterface
32+
UnliftedFFITypes
33+
NoUnliftedFFITypes
34+
InterruptibleFFI
35+
NoInterruptibleFFI
36+
CApiFFI
37+
NoCApiFFI
38+
GHCForeignImportPrim
39+
NoGHCForeignImportPrim
40+
NoJavaScriptFFI
41+
ParallelArrays
42+
NoParallelArrays
43+
Arrows
44+
NoArrows
45+
TemplateHaskell
46+
NoTemplateHaskell
47+
TemplateHaskellQuotes
48+
NoTemplateHaskellQuotes
49+
QualifiedDo
50+
NoQualifiedDo
51+
QuasiQuotes
52+
NoQuasiQuotes
53+
ImplicitParams
54+
NoImplicitParams
55+
ImplicitPrelude
56+
NoImplicitPrelude
57+
ScopedTypeVariables
58+
NoScopedTypeVariables
59+
PatternSignatures
60+
NoPatternSignatures
61+
AllowAmbiguousTypes
62+
NoAllowAmbiguousTypes
63+
UnboxedTuples
64+
NoUnboxedTuples
65+
UnboxedSums
66+
NoUnboxedSums
67+
UnliftedNewtypes
68+
NoUnliftedNewtypes
69+
UnliftedDatatypes
70+
NoUnliftedDatatypes
71+
BangPatterns
72+
NoBangPatterns
73+
TypeFamilies
74+
NoTypeFamilies
75+
TypeFamilyDependencies
76+
NoTypeFamilyDependencies
77+
TypeInType
78+
NoTypeInType
79+
OverloadedStrings
80+
NoOverloadedStrings
81+
OverloadedLists
82+
NoOverloadedLists
83+
NumDecimals
84+
NoNumDecimals
85+
DisambiguateRecordFields
86+
NoDisambiguateRecordFields
87+
RecordWildCards
88+
NoRecordWildCards
89+
NamedFieldPuns
90+
NoNamedFieldPuns
91+
RecordPuns
92+
NoRecordPuns
93+
ViewPatterns
94+
NoViewPatterns
95+
OrPatterns
96+
NoOrPatterns
97+
GADTs
98+
NoGADTs
99+
GADTSyntax
100+
NoGADTSyntax
101+
NPlusKPatterns
102+
NoNPlusKPatterns
103+
DoAndIfThenElse
104+
NoDoAndIfThenElse
105+
BlockArguments
106+
NoBlockArguments
107+
RebindableSyntax
108+
NoRebindableSyntax
109+
ConstraintKinds
110+
NoConstraintKinds
111+
PolyKinds
112+
NoPolyKinds
113+
DataKinds
114+
NoDataKinds
115+
TypeData
116+
NoTypeData
117+
InstanceSigs
118+
NoInstanceSigs
119+
ApplicativeDo
120+
NoApplicativeDo
121+
LinearTypes
122+
NoLinearTypes
123+
RequiredTypeArguments
124+
NoRequiredTypeArguments
125+
StandaloneDeriving
126+
NoStandaloneDeriving
127+
DeriveDataTypeable
128+
NoDeriveDataTypeable
129+
AutoDeriveTypeable
130+
NoAutoDeriveTypeable
131+
DeriveFunctor
132+
NoDeriveFunctor
133+
DeriveTraversable
134+
NoDeriveTraversable
135+
DeriveFoldable
136+
NoDeriveFoldable
137+
DeriveGeneric
138+
NoDeriveGeneric
139+
DefaultSignatures
140+
NoDefaultSignatures
141+
DeriveAnyClass
142+
NoDeriveAnyClass
143+
DeriveLift
144+
NoDeriveLift
145+
DerivingStrategies
146+
NoDerivingStrategies
147+
DerivingVia
148+
NoDerivingVia
149+
TypeSynonymInstances
150+
NoTypeSynonymInstances
151+
FlexibleContexts
152+
NoFlexibleContexts
153+
FlexibleInstances
154+
NoFlexibleInstances
155+
ConstrainedClassMethods
156+
NoConstrainedClassMethods
157+
MultiParamTypeClasses
158+
NoMultiParamTypeClasses
159+
NullaryTypeClasses
160+
NoNullaryTypeClasses
161+
FunctionalDependencies
162+
NoFunctionalDependencies
163+
UnicodeSyntax
164+
NoUnicodeSyntax
165+
ExistentialQuantification
166+
NoExistentialQuantification
167+
MagicHash
168+
NoMagicHash
169+
EmptyDataDecls
170+
NoEmptyDataDecls
171+
KindSignatures
172+
NoKindSignatures
173+
RoleAnnotations
174+
NoRoleAnnotations
175+
ParallelListComp
176+
NoParallelListComp
177+
TransformListComp
178+
NoTransformListComp
179+
MonadComprehensions
180+
NoMonadComprehensions
181+
GeneralizedNewtypeDeriving
182+
NoGeneralizedNewtypeDeriving
183+
GeneralisedNewtypeDeriving
184+
NoGeneralisedNewtypeDeriving
185+
RecursiveDo
186+
NoRecursiveDo
187+
DoRec
188+
NoDoRec
189+
PostfixOperators
190+
NoPostfixOperators
191+
TupleSections
192+
NoTupleSections
193+
PatternGuards
194+
NoPatternGuards
195+
LiberalTypeSynonyms
196+
NoLiberalTypeSynonyms
197+
RankNTypes
198+
NoRankNTypes
199+
Rank2Types
200+
NoRank2Types
201+
PolymorphicComponents
202+
NoPolymorphicComponents
203+
ImpredicativeTypes
204+
NoImpredicativeTypes
205+
TypeOperators
206+
NoTypeOperators
207+
ExplicitNamespaces
208+
NoExplicitNamespaces
209+
PackageImports
210+
NoPackageImports
211+
ExplicitForAll
212+
NoExplicitForAll
213+
AlternativeLayoutRule
214+
NoAlternativeLayoutRule
215+
AlternativeLayoutRuleTransitional
216+
NoAlternativeLayoutRuleTransitional
217+
DatatypeContexts
218+
NoDatatypeContexts
219+
NondecreasingIndentation
220+
NoNondecreasingIndentation
221+
RelaxedLayout
222+
NoRelaxedLayout
223+
TraditionalRecordSyntax
224+
NoTraditionalRecordSyntax
225+
LambdaCase
226+
NoLambdaCase
227+
MultiWayIf
228+
NoMultiWayIf
229+
BinaryLiterals
230+
NoBinaryLiterals
231+
NegativeLiterals
232+
NoNegativeLiterals
233+
HexFloatLiterals
234+
NoHexFloatLiterals
235+
DuplicateRecordFields
236+
NoDuplicateRecordFields
237+
OverloadedLabels
238+
NoOverloadedLabels
239+
EmptyCase
240+
NoEmptyCase
241+
PatternSynonyms
242+
NoPatternSynonyms
243+
PartialTypeSignatures
244+
NoPartialTypeSignatures
245+
NamedWildCards
246+
NoNamedWildCards
247+
StaticPointers
248+
NoStaticPointers
249+
TypeApplications
250+
NoTypeApplications
251+
Strict
252+
NoStrict
253+
StrictData
254+
NoStrictData
255+
EmptyDataDeriving
256+
NoEmptyDataDeriving
257+
NumericUnderscores
258+
NoNumericUnderscores
259+
QuantifiedConstraints
260+
NoQuantifiedConstraints
261+
StarIsType
262+
NoStarIsType
263+
ImportQualifiedPost
264+
NoImportQualifiedPost
265+
CUSKs
266+
NoCUSKs
267+
StandaloneKindSignatures
268+
NoStandaloneKindSignatures
269+
LexicalNegation
270+
NoLexicalNegation
271+
FieldSelectors
272+
NoFieldSelectors
273+
OverloadedRecordDot
274+
NoOverloadedRecordDot
275+
OverloadedRecordUpdate
276+
NoOverloadedRecordUpdate
277+
TypeAbstractions
278+
NoTypeAbstractions
279+
ExtendedLiterals
280+
NoExtendedLiterals
281+
ListTuplePuns
282+
NoListTuplePuns
283+
MultilineStrings
284+
NoMultilineStrings
285+
ExplicitLevelImports
286+
NoExplicitLevelImports
287+
ImplicitStagePersistence
288+
NoImplicitStagePersistence

0 commit comments

Comments
 (0)