GHC 2021¶
Motivation¶
The GHC20xx process proposal motivates why we feel the need for GHC20xx
extensions in general.
GHC2021
is the first iteration of this process, which makes it a bit special: It is large, as it includes all the obvious, low-hanging fruit. And because it introduces the concept to our users, it heavily influences acceptance and adoption of the whole idea. Therefore, this iteration is on the slightly conservative side, excluding some extensions that almost made it.
Proposed Change¶
The GHC2021
language extension set comprises of the following language extensions, relative to Haskell2010:
Syntax: EmptyCase, PostfixOperators, TupleSections, ImportQualifiedPost, NamedFieldPuns, BangPatterns
Literals: BinaryLiterals, HexFloatLiterals, NumericUnderscores
Types: GADTSyntax, RankNTypes, TypeApplications, PolyKinds, StandaloneKindSignatures, ExistentialQuantification, TypeOperators, ConstraintKinds
Type signatures: ExplicitForAll, KindSignatures, NamedWildCards, ScopedTypeVariables
Class and instances declarations: FlexibleContexts, FlexibleInstances, MultiParamTypeClasses, ConstrainedClassMethods, InstanceSigs, TypeSynonymInstances
Deriving mechanism: DeriveDataTypeable, DeriveFoldable, DeriveFunctor, DeriveTraversable, StandaloneDeriving, EmptyDataDeriving, DeriveLift, GeneralisedNewtypeDeriving, DeriveGeneric
As a reminder, the following extensions are part of Haskell2010, and continue to be enabled:
ImplicitPrelude
, StarIsType,MonomorphismRestriction
,TraditionalRecordSyntax
, EmptyDataDecls, ForeignFunctionInterface,PatternGuards
,DoAndIfThenElse
,RelaxedPolyRec
.GHC already treated MonadFailDesugaring as if it were part of Haskell2010 (see documented divergences), and the same holds for
GHC2021
. The extension was removed in 9.0.1.
The following deprecated extensions, which are part of Haskell2010, are _not_ included in GHC2021
:
CUSKs (replaced by StandaloneKindSignatures)
DatatypeContexts (deprecated)
The GHC2021
language set works analogously to the existing Haskell98
and Haskell2010
language set. In particular, there is no -XNoGHC2021
.
Data¶
The following table contains the information that was gathered to help the committee decide, based on an analysis of hackage and a community poll, as well as the tallied votes. At a committe size of 11, 8 votes are necessary to include an extension in GHC2021
:
The columns are:
Since: First version that ships this extension
Some Extension may have had serious changes since then.
Proliferation: #(packages using that extensions)/#(packages parsed)
Innocuousness: #(packages enable it in .cabal)/#(packages using default-extensions)
A high number here indicates that many developers want this on by default in their project, across all modules.
Aloofness: #(packages using this, but _only_ in modules, despite using default-extensions) /#(packages using default-extensions)
A high number here indicates that, although a developer was in principle happy with putting extensions into the default-extensions field, they did not include this particular one. I take this as an indication that this extension does _not_ make a great on-by-default extension. (Matching my expectation, TemplateHaskell and CPP make the highest here)
Popularity: #(users who want this)/#(users who filled out the poll)
Contentionsness: #(users who don’t want this)/#(users who want this)
Votes: #(committee members in favor)/#(commitee members already votes)
Once all votes are in, 66.6% here indicate that the extension would be accepted.
The raw data (input and aggregated) is found at https://github.com/nomeata/ghc-proposals-stats/blob/master/ext-stats/GHC2021 and the steps to produce them are noted in https://github.com/nomeata/ghc-proposals-stats/blob/master/ext-stats/README.md. This contains an easy setup to load the data into GHCI to play around with ist (custom sorting, etc.)
Caveats:
The hackage data is based on the the latest version of each hackage package. This skews heavily towards libraries, which are more likely to be found on Hackage than executable. It also puts higher weight on projects that are split into many haskell packages (e.g. amazonka).
The poll data has no serious protection aginst double voting, and skews heavily towards the part of the community that is reached by the poll announcemnt.
Data based on 13951 hackage packages, 1348 survey responses and 11 committee votes. (Votes may be changed. Bold votes are currently above 2/3.)
Extension |
Votes |
AM |
AS |
CC |
ES |
ID |
JB |
RE |
SJ |
SM |
TH |
VB |
Since |
Pop… |
Cont… |
Prolif… |
Innoc… |
Aloof… |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
6.8.1 |
35% |
9% |
13% |
22% |
7% |
|
11 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
7.10.1 |
17% |
23% |
1% |
3% |
0 |
|
11 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
7.4.1 |
21% |
19% |
9% |
27% |
7% |
|
11 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
6.8.1 |
21% |
16% |
19% |
23% |
8% |
|
11 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
7.10.1 |
32% |
9% |
5% |
19% |
2% |
|
11 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
7.10.1 |
36% |
8% |
9% |
25% |
6% |
|
11 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
7.2.1 |
38% |
7% |
17% |
29% |
12% |
|
11 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
7.10.1 |
29% |
10% |
5% |
19% |
3% |
|
11 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
7.8.1 |
18% |
20% |
1% |
5% |
1% |
|
11 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
6.8.1 |
8% |
4% |
0 |
14% |
0 |
|
11 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
6.12.1 |
18% |
27% |
1% |
1% |
1% |
|
11 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
6.8.1 |
29% |
13% |
29% |
45% |
14% |
|
11 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
6.8.1 |
29% |
13% |
33% |
46% |
16% |
|
11 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
7.2.1 |
18% |
24% |
0% |
0% |
0 |
|
11 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
8.4.1 |
9% |
52% |
0% |
0 |
0 |
|
11 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
6.8.1 |
24% |
12% |
7% |
12% |
4% |
|
11 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
6.8.1 |
27% |
11% |
23% |
37% |
11% |
|
11 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
6.8.1 |
22% |
12% |
10% |
26% |
6% |
|
10 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
6.8.1 |
4% |
138% |
0% |
0% |
0% |
||
10 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
8.4.1 |
0 |
N/A |
0% |
0 |
0% |
||
Extension |
Votes |
AM |
AS |
CC |
ES |
ID |
JB |
RE |
SJ |
SM |
TH |
VB |
Since |
Pop… |
Cont… |
Prolif… |
Innoc… |
Aloof… |
10 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
8.10.1 |
4% |
70% |
0 |
0 |
0 |
||
10 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
7.6.1 |
19% |
16% |
3% |
11% |
2% |
||
10 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
8.6.1 |
18% |
15% |
0% |
0% |
0% |
||
10 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
7.10.1 |
3% |
229% |
0% |
0% |
0% |
||
10 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
6.8.1 |
39% |
22% |
21% |
31% |
12% |
||
10 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
8.6.1 |
0 |
N/A |
0 |
0% |
0 |
||
10 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
8.0.1 |
29% |
11% |
6% |
14% |
5% |
||
9 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
8.0.1 |
19% |
19% |
1% |
2% |
0% |
|||
9 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
6.8.1 |
3% |
211% |
0 |
4% |
0 |
|||
9 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
6.8.1 |
28% |
12% |
19% |
31% |
14% |
|||
9 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
6.10.1 |
18% |
24% |
5% |
10% |
3% |
|||
9 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
7.4.1 |
11% |
41% |
5% |
11% |
4% |
|||
9 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
8.10.1 |
8% |
28% |
0% |
0 |
0% |
|||
9 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
6.8.1 |
7% |
74% |
10% |
8% |
7% |
|||
8 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
6.8.1 |
15% |
30% |
7% |
7% |
6% |
||||
8 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
8.0.1 |
7% |
15% |
0% |
2% |
0 |
||||
8 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
7.10.1 |
8% |
65% |
0% |
1% |
0 |
||||
8 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
6.8.1 |
33% |
8% |
29% |
41% |
14% |
||||
8 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
6.12 |
27% |
12% |
10% |
27% |
7% |
||||
8 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
6.8.1 |
20% |
17% |
14% |
28% |
6% |
||||
Extension |
Votes |
AM |
AS |
CC |
ES |
ID |
JB |
RE |
SJ |
SM |
TH |
VB |
Since |
Pop… |
Cont… |
Prolif… |
Innoc… |
Aloof… |
7 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
8.2.1 |
27% |
11% |
1% |
3% |
1% |
|||||
7 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
6.8.1 |
34% |
13% |
13% |
25% |
8% |
|||||
7 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
6.12.1 |
2% |
279% |
1% |
1% |
1% |
|||||
7 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
6.8.1 |
45% |
12% |
37% |
53% |
12% |
|||||
7 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
6.8.1 |
16% |
39% |
17% |
28% |
9% |
|||||
7 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
6.8.1 |
24% |
18% |
23% |
33% |
11% |
|||||
6 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
7.4.1 |
26% |
21% |
13% |
28% |
8% |
||||||
6 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
7.6.1 |
46% |
6% |
14% |
34% |
5% |
||||||
6 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
7.8.1 |
7% |
58% |
0% |
2% |
0% |
||||||
6 |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
6.8.1 |
7% |
99% |
2% |
7% |
0% |
||||||
5 |
✔ |
✔ |
✔ |
✔ |
✔ |
7.2.1 |
16% |
26% |
6% |
19% |
4% |
|||||||
5 |
✔ |
✔ |
✔ |
✔ |
✔ |
8.6.1 |
30% |
10% |
0% |
1% |
1% |
|||||||
5 |
✔ |
✔ |
✔ |
✔ |
✔ |
6.8.1 |
17% |
27% |
9% |
22% |
6% |
|||||||
5 |
✔ |
✔ |
✔ |
✔ |
✔ |
6.8.1 |
4% |
131% |
4% |
11% |
3% |
|||||||
5 |
✔ |
✔ |
✔ |
✔ |
✔ |
7.8.1 |
4% |
107% |
0% |
1% |
0% |
|||||||
5 |
✔ |
✔ |
✔ |
✔ |
✔ |
7.8.1 |
6% |
75% |
1% |
1% |
1% |
|||||||
5 |
✔ |
✔ |
✔ |
✔ |
✔ |
6.10.1 |
20% |
22% |
7% |
10% |
6% |
|||||||
4 |
✔ |
✔ |
✔ |
✔ |
7.6.1 |
4% |
138% |
1% |
0% |
1% |
||||||||
4 |
✔ |
✔ |
✔ |
✔ |
7.8.1 |
3% |
145% |
0% |
0 |
0 |
||||||||
4 |
✔ |
✔ |
✔ |
✔ |
7.8.1 |
10% |
81% |
1% |
1% |
2% |
||||||||
Extension |
Votes |
AM |
AS |
CC |
ES |
ID |
JB |
RE |
SJ |
SM |
TH |
VB |
Since |
Pop… |
Cont… |
Prolif… |
Innoc… |
Aloof… |
4 |
✔ |
✔ |
✔ |
✔ |
6.8.1 |
4% |
175% |
1% |
9% |
0% |
||||||||
4 |
✔ |
✔ |
✔ |
✔ |
8.10.1 |
3% |
121% |
0% |
0 |
0 |
||||||||
3 |
✔ |
✔ |
✔ |
8.6.1 |
12% |
63% |
0% |
2% |
0% |
|||||||||
3 |
✔ |
✔ |
✔ |
6.8.1 |
6% |
105% |
0% |
1% |
0% |
|||||||||
3 |
✔ |
✔ |
✔ |
9.0.1 |
0 |
N/A |
0 |
0 |
0 |
|||||||||
3 |
✔ |
✔ |
✔ |
6.8.1 |
5% |
105% |
1% |
9% |
0% |
|||||||||
3 |
✔ |
✔ |
✔ |
7.6.1 |
22% |
20% |
4% |
17% |
2% |
|||||||||
3 |
✔ |
✔ |
✔ |
6.8.1 |
5% |
135% |
1% |
2% |
1% |
|||||||||
3 |
✔ |
✔ |
✔ |
8.0.1 |
9% |
59% |
1% |
2% |
1% |
|||||||||
2 |
✔ |
✔ |
? |
0 |
N/A |
0% |
1% |
0% |
||||||||||
2 |
✔ |
✔ |
7.10.1 |
7% |
84% |
1% |
6% |
1% |
||||||||||
2 |
✔ |
✔ |
7.8.1 |
14% |
24% |
3% |
6% |
4% |
||||||||||
2 |
✔ |
✔ |
8.0.1 |
2% |
446% |
0% |
0% |
0% |
||||||||||
1 |
✔ |
8.0.1 |
14% |
65% |
1% |
2% |
1% |
|||||||||||
1 |
✔ |
6.8.1 |
4% |
284% |
2% |
9% |
0% |
|||||||||||
1 |
✔ |
7.10.1 |
2% |
404% |
0% |
0% |
0% |
|||||||||||
1 |
✔ |
8.0.1 |
11% |
63% |
1% |
4% |
2% |
|||||||||||
1 |
✔ |
6.8.1 |
4% |
160% |
4% |
9% |
2% |
|||||||||||
1 |
✔ |
6.10.1 |
6% |
96% |
2% |
3% |
1% |
|||||||||||
1 |
✔ |
8.6.1 |
7% |
74% |
0% |
1% |
1% |
|||||||||||
Extension |
Votes |
AM |
AS |
CC |
ES |
ID |
JB |
RE |
SJ |
SM |
TH |
VB |
Since |
Pop… |
Cont… |
Prolif… |
Innoc… |
Aloof… |
1 |
✔ |
6.10.1 |
6% |
121% |
7% |
14% |
7% |
|||||||||||
1 |
✔ |
6.0 |
6% |
176% |
18% |
19% |
17% |
|||||||||||
1 |
✔ |
8.0.1 |
6% |
95% |
1% |
1% |
1% |
|||||||||||
1 |
✔ |
8.2.1 |
4% |
140% |
0% |
0 |
0% |
|||||||||||
1 |
✔ |
6.8.1 |
5% |
134% |
3% |
8% |
1% |
|||||||||||
1 |
✔ |
6.8.1 |
0 |
N/A |
0% |
0% |
0% |
|||||||||||
0 |
7.8.1 |
4% |
348% |
3% |
3% |
4% |
||||||||||||
0 |
6.8.1 |
2% |
640% |
23% |
10% |
20% |
||||||||||||
0 |
8.10.1 |
0 |
N/A |
0% |
0 |
0% |
||||||||||||
0 |
7.0.1 |
2% |
411% |
0 |
0 |
0 |
||||||||||||
0 |
7.10.1 |
17% |
43% |
3% |
2% |
5% |
||||||||||||
0 |
6.8.1 |
1% |
544% |
1% |
0% |
1% |
||||||||||||
0 |
6.12.1 |
0 |
N/A |
0% |
0 |
0% |
||||||||||||
0 |
6.8.1 |
1% |
817% |
1% |
1% |
1% |
||||||||||||
0 |
6.10.1 |
1% |
645% |
1% |
1% |
1% |
||||||||||||
0 |
6.8.1 |
1% |
2514% |
1% |
0% |
1% |
||||||||||||
0 |
7.2.1 |
1% |
643% |
0% |
0 |
0% |
||||||||||||
0 |
9.0.1 |
0 |
N/A |
0 |
0 |
0 |
||||||||||||
0 |
7.2.1 |
5% |
167% |
0% |
3% |
0% |
||||||||||||
0 |
6.12.1 |
1% |
1023% |
0 |
0 |
0 |
||||||||||||
Extension |
Votes |
AM |
AS |
CC |
ES |
ID |
JB |
RE |
SJ |
SM |
TH |
VB |
Since |
Pop… |
Cont… |
Prolif… |
Innoc… |
Aloof… |
0 |
6.8.1 |
7% |
128% |
8% |
30% |
2% |
||||||||||||
0 |
6.8.1 |
0% |
3600% |
0 |
0 |
0 |
||||||||||||
0 |
7.4.1 |
1% |
1243% |
0 |
0 |
0 |
||||||||||||
0 |
? |
2% |
514% |
2% |
0% |
2% |
||||||||||||
0 |
8.0.1 |
8% |
89% |
1% |
2% |
0% |
||||||||||||
0 |
9.0.1 |
0 |
N/A |
0 |
0 |
0 |
||||||||||||
0 |
7.0.1 |
1% |
788% |
1% |
1% |
1% |
||||||||||||
0 |
7.2.1 |
0 |
N/A |
0 |
0 |
0 |
||||||||||||
0 |
7.10.1 |
1% |
654% |
0% |
0 |
0% |
||||||||||||
0 |
8.0.1 |
1% |
805% |
0% |
1% |
0% |
||||||||||||
0 |
8.0.1 |
4% |
256% |
1% |
3% |
1% |
||||||||||||
0 |
6.10.1 |
1% |
731% |
0% |
0 |
0 |
||||||||||||
0 |
7.2.1 |
0% |
2180% |
0 |
0 |
0 |
||||||||||||
0 |
? |
3% |
411% |
14% |
7% |
16% |
||||||||||||
0 |
8.0.1 |
1% |
1675% |
1% |
0% |
1% |
||||||||||||
0 |
7.4.1 |
0% |
3475% |
0 |
0 |
0 |