Embrace -XTypeInType, add -XStarIsType
authorVladislav Zavialov <vlad.z.4096@gmail.com>
Thu, 14 Jun 2018 19:02:36 +0000 (15:02 -0400)
committerRichard Eisenberg <rae@cs.brynmawr.edu>
Thu, 14 Jun 2018 19:05:32 +0000 (15:05 -0400)
commitd650729f9a0f3b6aa5e6ef2d5fba337f6f70fa60
treeac224609397d4b7ca7072fc87739d2522be7675b
parent4672e2ebf040feffde4e7e2d79c479e4c0c3efaf
Embrace -XTypeInType, add -XStarIsType

Summary:
Implement the "Embrace Type :: Type" GHC proposal,
.../ghc-proposals/blob/master/proposals/0020-no-type-in-type.rst

GHC 8.0 included a major change to GHC's type system: the Type :: Type
axiom. Though casual users were protected from this by hiding its
features behind the -XTypeInType extension, all programs written in GHC
8+ have the axiom behind the scenes. In order to preserve backward
compatibility, various legacy features were left unchanged. For example,
with -XDataKinds but not -XTypeInType, GADTs could not be used in types.
Now these restrictions are lifted and -XTypeInType becomes a redundant
flag that will be eventually deprecated.

* Incorporate the features currently in -XTypeInType into the
  -XPolyKinds and -XDataKinds extensions.
* Introduce a new extension -XStarIsType to control how to parse * in
  code and whether to print it in error messages.

Test Plan: Validate

Reviewers: goldfire, hvr, bgamari, alanz, simonpj

Reviewed By: goldfire, simonpj

Subscribers: rwbarton, thomie, mpickering, carter

GHC Trac Issues: #15195

Differential Revision: https://phabricator.haskell.org/D4748
391 files changed:
.gitignore
.gitmodules
compiler/basicTypes/DataCon.hs
compiler/basicTypes/Name.hs
compiler/basicTypes/RdrName.hs
compiler/basicTypes/SrcLoc.hs
compiler/deSugar/DsMeta.hs
compiler/hsSyn/Convert.hs
compiler/hsSyn/HsDecls.hs
compiler/hsSyn/HsExtension.hs
compiler/hsSyn/HsInstances.hs
compiler/hsSyn/HsTypes.hs
compiler/iface/IfaceType.hs
compiler/main/DynFlags.hs
compiler/main/DynFlags.hs-boot
compiler/main/HscTypes.hs
compiler/parser/Lexer.x
compiler/parser/Parser.y
compiler/parser/RdrHsSyn.hs
compiler/prelude/PrelNames.hs
compiler/prelude/PrelNames.hs-boot
compiler/prelude/TysWiredIn.hs
compiler/rename/RnEnv.hs
compiler/rename/RnSource.hs
compiler/rename/RnTypes.hs
compiler/typecheck/TcDeriv.hs
compiler/typecheck/TcHsType.hs
compiler/typecheck/TcInstDcls.hs
compiler/typecheck/TcMType.hs
compiler/typecheck/TcPatSyn.hs
compiler/typecheck/TcRnTypes.hs
compiler/typecheck/TcSplice.hs
compiler/typecheck/TcTyClsDecls.hs
compiler/types/Kind.hs
compiler/types/TyCoRep.hs
compiler/types/TyCon.hs
compiler/types/Type.hs
compiler/types/Unify.hs
compiler/utils/Outputable.hs
docs/users_guide/8.6.1-notes.rst
docs/users_guide/glasgow_exts.rst
libraries/base/Data/Data.hs
libraries/base/Data/Kind.hs
libraries/base/Data/Proxy.hs
libraries/base/Data/Type/Equality.hs
libraries/base/Data/Typeable.hs
libraries/base/Data/Typeable/Internal.hs
libraries/base/GHC/Base.hs
libraries/base/GHC/Err.hs
libraries/base/GHC/Generics.hs
libraries/base/Type/Reflection/Unsafe.hs
libraries/base/tests/CatEntail.hs
libraries/ghc-boot-th/GHC/LanguageExtensions/Type.hs
libraries/ghc-prim/GHC/Magic.hs
libraries/ghc-prim/GHC/Types.hs
testsuite/tests/codeGen/should_fail/T13233.hs
testsuite/tests/dependent/ghci/T11549.script
testsuite/tests/dependent/ghci/T14238.stdout
testsuite/tests/dependent/should_compile/Dep1.hs
testsuite/tests/dependent/should_compile/Dep2.hs
testsuite/tests/dependent/should_compile/Dep3.hs
testsuite/tests/dependent/should_compile/DkNameRes.hs [new file with mode: 0644]
testsuite/tests/dependent/should_compile/InferDependency.hs [deleted file]
testsuite/tests/dependent/should_compile/KindEqualities.hs
testsuite/tests/dependent/should_compile/KindEqualities2.hs
testsuite/tests/dependent/should_compile/KindLevels.hs
testsuite/tests/dependent/should_compile/RAE_T32b.hs
testsuite/tests/dependent/should_compile/Rae31.hs
testsuite/tests/dependent/should_compile/RaeBlogPost.hs
testsuite/tests/dependent/should_compile/RaeJobTalk.hs
testsuite/tests/dependent/should_compile/T11405.hs
testsuite/tests/dependent/should_compile/T11635.hs
testsuite/tests/dependent/should_compile/T11711.hs
testsuite/tests/dependent/should_compile/T11719.hs
testsuite/tests/dependent/should_compile/T11966.hs
testsuite/tests/dependent/should_compile/T12176.hs
testsuite/tests/dependent/should_compile/T12442.hs
testsuite/tests/dependent/should_compile/T12742.hs
testsuite/tests/dependent/should_compile/T13910.hs
testsuite/tests/dependent/should_compile/T13938.hs
testsuite/tests/dependent/should_compile/T13938a.hs
testsuite/tests/dependent/should_compile/T14038.hs
testsuite/tests/dependent/should_compile/T14066a.hs
testsuite/tests/dependent/should_compile/T14556.hs
testsuite/tests/dependent/should_compile/T14720.hs
testsuite/tests/dependent/should_compile/T14749.hs
testsuite/tests/dependent/should_compile/T14991.hs
testsuite/tests/dependent/should_compile/T9632.hs
testsuite/tests/dependent/should_compile/TypeLevelVec.hs
testsuite/tests/dependent/should_compile/all.T
testsuite/tests/dependent/should_compile/dynamic-paper.hs
testsuite/tests/dependent/should_compile/mkGADTVars.hs
testsuite/tests/dependent/should_fail/BadTelescope.hs
testsuite/tests/dependent/should_fail/BadTelescope2.hs
testsuite/tests/dependent/should_fail/BadTelescope3.hs
testsuite/tests/dependent/should_fail/BadTelescope4.hs
testsuite/tests/dependent/should_fail/DepFail1.hs
testsuite/tests/dependent/should_fail/InferDependency.hs
testsuite/tests/dependent/should_fail/KindLevelsB.hs [deleted file]
testsuite/tests/dependent/should_fail/KindLevelsB.stderr [deleted file]
testsuite/tests/dependent/should_fail/PromotedClass.hs
testsuite/tests/dependent/should_fail/RAE_T32a.hs
testsuite/tests/dependent/should_fail/RAE_T32a.stderr
testsuite/tests/dependent/should_fail/RenamingStar.hs
testsuite/tests/dependent/should_fail/RenamingStar.stderr
testsuite/tests/dependent/should_fail/SelfDep.hs
testsuite/tests/dependent/should_fail/SelfDep.stderr
testsuite/tests/dependent/should_fail/T11407.hs
testsuite/tests/dependent/should_fail/T11473.hs
testsuite/tests/dependent/should_fail/T12081.hs
testsuite/tests/dependent/should_fail/T12174.hs
testsuite/tests/dependent/should_fail/T13135.hs
testsuite/tests/dependent/should_fail/T13601.hs
testsuite/tests/dependent/should_fail/T13780a.hs
testsuite/tests/dependent/should_fail/T13780b.hs
testsuite/tests/dependent/should_fail/T13780c.hs
testsuite/tests/dependent/should_fail/T13780c.stderr
testsuite/tests/dependent/should_fail/T14066.hs
testsuite/tests/dependent/should_fail/T14066c.hs
testsuite/tests/dependent/should_fail/T14066d.hs
testsuite/tests/dependent/should_fail/T14066e.hs
testsuite/tests/dependent/should_fail/T14066f.hs
testsuite/tests/dependent/should_fail/T14066g.hs
testsuite/tests/dependent/should_fail/T14066h.hs
testsuite/tests/dependent/should_fail/T15245.hs [new file with mode: 0644]
testsuite/tests/dependent/should_fail/T15245.stderr [new file with mode: 0644]
testsuite/tests/dependent/should_fail/TypeSkolEscape.hs
testsuite/tests/dependent/should_fail/all.T
testsuite/tests/dependent/should_run/T11964a.hs
testsuite/tests/deriving/should_compile/T11416.hs
testsuite/tests/deriving/should_compile/T11732a.hs
testsuite/tests/deriving/should_compile/T11732b.hs
testsuite/tests/deriving/should_compile/T11732c.hs
testsuite/tests/deriving/should_compile/T14331.hs
testsuite/tests/deriving/should_compile/T14579.hs
testsuite/tests/deriving/should_compile/T14932.hs
testsuite/tests/deriving/should_fail/T12512.hs
testsuite/tests/deriving/should_fail/T14728a.hs
testsuite/tests/deriving/should_fail/T14728b.hs
testsuite/tests/deriving/should_fail/T15073.hs
testsuite/tests/determinism/determ004/determ004.hs
testsuite/tests/determinism/determ014/A.hs
testsuite/tests/driver/T4437.hs
testsuite/tests/gadt/T7293.hs
testsuite/tests/gadt/T7293.stderr
testsuite/tests/gadt/T7294.hs
testsuite/tests/gadt/T7294.stderr
testsuite/tests/generics/GEq/GEq1.hs
testsuite/tests/ghci/scripts/T10321.hs
testsuite/tests/ghci/scripts/T11252.script
testsuite/tests/ghci/scripts/T11376.script
testsuite/tests/ghci/scripts/T12550.script
testsuite/tests/ghci/scripts/T13407.script
testsuite/tests/ghci/scripts/T13963.script
testsuite/tests/ghci/scripts/T13988.hs
testsuite/tests/ghci/scripts/T7873.script
testsuite/tests/ghci/scripts/T7939.hs
testsuite/tests/ghci/scripts/T8357.hs
testsuite/tests/indexed-types/should_compile/HO.hs
testsuite/tests/indexed-types/should_compile/Numerals.hs
testsuite/tests/indexed-types/should_compile/T12369.hs
testsuite/tests/indexed-types/should_compile/T12522b.hs
testsuite/tests/indexed-types/should_compile/T12938.hs
testsuite/tests/indexed-types/should_compile/T13244.hs
testsuite/tests/indexed-types/should_compile/T13398b.hs
testsuite/tests/indexed-types/should_compile/T14162.hs
testsuite/tests/indexed-types/should_compile/T14554.hs
testsuite/tests/indexed-types/should_compile/T15122.hs
testsuite/tests/indexed-types/should_compile/T2219.hs
testsuite/tests/indexed-types/should_compile/T7585.hs
testsuite/tests/indexed-types/should_compile/T9747.hs
testsuite/tests/indexed-types/should_fail/T12522a.hs
testsuite/tests/indexed-types/should_fail/T12522a.stderr
testsuite/tests/indexed-types/should_fail/T13674.hs
testsuite/tests/indexed-types/should_fail/T13784.hs
testsuite/tests/indexed-types/should_fail/T13784.stderr
testsuite/tests/indexed-types/should_fail/T13877.hs
testsuite/tests/indexed-types/should_fail/T13972.hs
testsuite/tests/indexed-types/should_fail/T14175.hs
testsuite/tests/indexed-types/should_fail/T14246.hs
testsuite/tests/indexed-types/should_fail/T14246.stderr
testsuite/tests/indexed-types/should_fail/T14369.hs
testsuite/tests/indexed-types/should_fail/T2544.hs
testsuite/tests/indexed-types/should_fail/T2544.stderr
testsuite/tests/indexed-types/should_fail/T3330c.hs
testsuite/tests/indexed-types/should_fail/T3330c.stderr
testsuite/tests/indexed-types/should_fail/T4174.hs
testsuite/tests/indexed-types/should_fail/T4174.stderr
testsuite/tests/indexed-types/should_fail/T7786.hs
testsuite/tests/indexed-types/should_fail/T7786.stderr
testsuite/tests/indexed-types/should_fail/T7967.hs
testsuite/tests/indexed-types/should_fail/T7967.stderr
testsuite/tests/indexed-types/should_fail/T9036.hs
testsuite/tests/indexed-types/should_fail/T9036.stderr
testsuite/tests/indexed-types/should_fail/T9662.hs
testsuite/tests/indexed-types/should_fail/T9662.stderr
testsuite/tests/indexed-types/should_run/T11465a.hs
testsuite/tests/overloadedrecflds/should_run/overloadedrecflds_generics.hs
testsuite/tests/overloadedrecflds/should_run/overloadedrecfldsrun07.hs
testsuite/tests/parser/should_compile/DumpParsedAst.stderr
testsuite/tests/parser/should_compile/DumpRenamedAst.hs
testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
testsuite/tests/parser/should_compile/T10379.hs
testsuite/tests/parser/should_fail/T15209.stderr
testsuite/tests/parser/should_fail/all.T
testsuite/tests/parser/should_fail/readFail036.hs
testsuite/tests/parser/should_fail/readFail036.stderr
testsuite/tests/parser/should_fail/typeops_A.hs [new file with mode: 0644]
testsuite/tests/parser/should_fail/typeops_A.stderr [new file with mode: 0644]
testsuite/tests/parser/should_fail/typeops_B.hs [new file with mode: 0644]
testsuite/tests/parser/should_fail/typeops_B.stderr [new file with mode: 0644]
testsuite/tests/parser/should_fail/typeops_C.hs [new file with mode: 0644]
testsuite/tests/parser/should_fail/typeops_C.stderr [new file with mode: 0644]
testsuite/tests/parser/should_fail/typeops_D.hs [new file with mode: 0644]
testsuite/tests/parser/should_fail/typeops_D.stderr [new file with mode: 0644]
testsuite/tests/partial-sigs/should_compile/T15039a.hs
testsuite/tests/partial-sigs/should_compile/T15039a.stderr
testsuite/tests/partial-sigs/should_compile/T15039b.hs
testsuite/tests/partial-sigs/should_compile/T15039b.stderr
testsuite/tests/partial-sigs/should_compile/T15039c.hs
testsuite/tests/partial-sigs/should_compile/T15039c.stderr
testsuite/tests/partial-sigs/should_compile/T15039d.hs
testsuite/tests/partial-sigs/should_compile/T15039d.stderr
testsuite/tests/partial-sigs/should_fail/T14040a.hs
testsuite/tests/partial-sigs/should_fail/T14584.hs
testsuite/tests/partial-sigs/should_fail/T14584.stderr
testsuite/tests/patsyn/should_compile/T12698.hs
testsuite/tests/patsyn/should_compile/T12968.hs
testsuite/tests/patsyn/should_compile/T13768.hs
testsuite/tests/patsyn/should_compile/T14058.hs
testsuite/tests/patsyn/should_compile/T14058a.hs
testsuite/tests/patsyn/should_fail/T14507.hs
testsuite/tests/patsyn/should_fail/T14507.stderr
testsuite/tests/patsyn/should_fail/T14552.hs
testsuite/tests/perf/compiler/T12227.hs
testsuite/tests/perf/compiler/T12545a.hs
testsuite/tests/perf/compiler/T13035.hs
testsuite/tests/perf/compiler/T13035.stderr
testsuite/tests/perf/compiler/T9872d.hs
testsuite/tests/pmcheck/complete_sigs/T14253.hs
testsuite/tests/pmcheck/should_compile/T14086.hs
testsuite/tests/pmcheck/should_compile/T3927b.hs
testsuite/tests/polykinds/MonoidsTF.hs
testsuite/tests/polykinds/PolyKinds10.hs
testsuite/tests/polykinds/SigTvKinds3.hs
testsuite/tests/polykinds/T10134a.hs
testsuite/tests/polykinds/T10934.hs
testsuite/tests/polykinds/T11142.hs
testsuite/tests/polykinds/T11399.hs
testsuite/tests/polykinds/T11480b.hs
testsuite/tests/polykinds/T11520.hs
testsuite/tests/polykinds/T11523.hs
testsuite/tests/polykinds/T11554.hs
testsuite/tests/polykinds/T11616.hs
testsuite/tests/polykinds/T11640.hs
testsuite/tests/polykinds/T11648.hs
testsuite/tests/polykinds/T11648b.hs
testsuite/tests/polykinds/T11821a.hs
testsuite/tests/polykinds/T12055.hs
testsuite/tests/polykinds/T12055a.hs
testsuite/tests/polykinds/T12593.hs
testsuite/tests/polykinds/T12668.hs
testsuite/tests/polykinds/T12718.hs
testsuite/tests/polykinds/T13391.hs [deleted file]
testsuite/tests/polykinds/T13391.stderr [deleted file]
testsuite/tests/polykinds/T13625.hs
testsuite/tests/polykinds/T13659.hs
testsuite/tests/polykinds/T13659.stderr
testsuite/tests/polykinds/T13738.hs
testsuite/tests/polykinds/T13985.stderr
testsuite/tests/polykinds/T14174.hs
testsuite/tests/polykinds/T14174a.hs
testsuite/tests/polykinds/T14209.hs
testsuite/tests/polykinds/T14270.hs
testsuite/tests/polykinds/T14450.hs
testsuite/tests/polykinds/T14450.stderr
testsuite/tests/polykinds/T14515.hs
testsuite/tests/polykinds/T14520.hs
testsuite/tests/polykinds/T14555.hs
testsuite/tests/polykinds/T14561.hs
testsuite/tests/polykinds/T14563.hs
testsuite/tests/polykinds/T14580.hs
testsuite/tests/polykinds/T14710.stderr
testsuite/tests/polykinds/T14846.hs
testsuite/tests/polykinds/T14873.hs
testsuite/tests/polykinds/T15170.hs
testsuite/tests/polykinds/T5716.hs
testsuite/tests/polykinds/T5716.stderr
testsuite/tests/polykinds/T6021.stderr [deleted file]
testsuite/tests/polykinds/T6035.hs
testsuite/tests/polykinds/T6039.stderr
testsuite/tests/polykinds/T6093.hs
testsuite/tests/polykinds/T7404.stderr [deleted file]
testsuite/tests/polykinds/T7594.hs
testsuite/tests/polykinds/T7594.stderr
testsuite/tests/polykinds/T8566.hs
testsuite/tests/polykinds/T8566.stderr
testsuite/tests/polykinds/T8566a.hs
testsuite/tests/polykinds/T8985.hs
testsuite/tests/polykinds/T9222.hs
testsuite/tests/polykinds/T9222.stderr
testsuite/tests/polykinds/all.T
testsuite/tests/printer/Ppr040.hs
testsuite/tests/printer/Ppr045.hs
testsuite/tests/rename/should_fail/T11592.hs
testsuite/tests/rename/should_fail/T13947.stderr
testsuite/tests/simplCore/should_compile/T13025a.hs
testsuite/tests/simplCore/should_compile/T13658.hs
testsuite/tests/simplCore/should_compile/T14270a.hs
testsuite/tests/simplCore/should_compile/T15186A.hs
testsuite/tests/simplCore/should_compile/T4903a.hs
testsuite/tests/simplCore/should_run/T13750a.hs
testsuite/tests/th/T11463.hs
testsuite/tests/th/T11484.hs
testsuite/tests/th/T13642.hs
testsuite/tests/th/T13781.hs
testsuite/tests/th/T14060.hs
testsuite/tests/th/T14869.hs
testsuite/tests/th/T8031.hs
testsuite/tests/th/TH_RichKinds2.hs
testsuite/tests/th/TH_RichKinds2.stderr
testsuite/tests/typecheck/should_compile/SplitWD.hs
testsuite/tests/typecheck/should_compile/T10432.hs
testsuite/tests/typecheck/should_compile/T11237.hs
testsuite/tests/typecheck/should_compile/T11348.hs
testsuite/tests/typecheck/should_compile/T11524.hs
testsuite/tests/typecheck/should_compile/T11723.hs
testsuite/tests/typecheck/should_compile/T11811.hs
testsuite/tests/typecheck/should_compile/T12133.hs
testsuite/tests/typecheck/should_compile/T12381.hs
testsuite/tests/typecheck/should_compile/T12734.hs
testsuite/tests/typecheck/should_compile/T12734a.hs
testsuite/tests/typecheck/should_compile/T12734a.stderr
testsuite/tests/typecheck/should_compile/T12785a.hs
testsuite/tests/typecheck/should_compile/T12911.hs
testsuite/tests/typecheck/should_compile/T12919.hs
testsuite/tests/typecheck/should_compile/T12987.hs
testsuite/tests/typecheck/should_compile/T13083.hs
testsuite/tests/typecheck/should_compile/T13333.hs
testsuite/tests/typecheck/should_compile/T13337.hs
testsuite/tests/typecheck/should_compile/T13343.hs
testsuite/tests/typecheck/should_compile/T13458.hs
testsuite/tests/typecheck/should_compile/T13603.hs
testsuite/tests/typecheck/should_compile/T13643.hs
testsuite/tests/typecheck/should_compile/T13822.hs
testsuite/tests/typecheck/should_compile/T13871.hs
testsuite/tests/typecheck/should_compile/T13879.hs
testsuite/tests/typecheck/should_compile/T13915a.hs
testsuite/tests/typecheck/should_compile/T13915b.hs
testsuite/tests/typecheck/should_compile/T13943.hs
testsuite/tests/typecheck/should_compile/T14441.hs
testsuite/tests/typecheck/should_compile/T14934a.hs
testsuite/tests/typecheck/should_compile/all.T
testsuite/tests/typecheck/should_compile/tc191.hs
testsuite/tests/typecheck/should_compile/tc205.hs
testsuite/tests/typecheck/should_compile/tc269.hs
testsuite/tests/typecheck/should_compile/valid_hole_fits_interactions.hs
testsuite/tests/typecheck/should_fail/ClassOperator.hs
testsuite/tests/typecheck/should_fail/ClassOperator.stderr
testsuite/tests/typecheck/should_fail/CustomTypeErrors04.hs
testsuite/tests/typecheck/should_fail/CustomTypeErrors05.hs
testsuite/tests/typecheck/should_fail/LevPolyBounded.hs
testsuite/tests/typecheck/should_fail/T11313.hs
testsuite/tests/typecheck/should_fail/T11313.stderr
testsuite/tests/typecheck/should_fail/T11724.hs
testsuite/tests/typecheck/should_fail/T11963.hs [deleted file]
testsuite/tests/typecheck/should_fail/T11963.stderr [deleted file]
testsuite/tests/typecheck/should_fail/T12648.hs
testsuite/tests/typecheck/should_fail/T12709.hs
testsuite/tests/typecheck/should_fail/T12709.stderr
testsuite/tests/typecheck/should_fail/T12785b.hs
testsuite/tests/typecheck/should_fail/T12973.hs
testsuite/tests/typecheck/should_fail/T13105.hs
testsuite/tests/typecheck/should_fail/T13446.hs
testsuite/tests/typecheck/should_fail/T13909.hs
testsuite/tests/typecheck/should_fail/T13929.hs
testsuite/tests/typecheck/should_fail/T13983.stderr
testsuite/tests/typecheck/should_fail/T14350.hs
testsuite/tests/typecheck/should_fail/T14904a.hs
testsuite/tests/typecheck/should_fail/T14904b.hs
testsuite/tests/typecheck/should_fail/T7645.hs
testsuite/tests/typecheck/should_fail/T7645.stderr
testsuite/tests/typecheck/should_fail/all.T
testsuite/tests/typecheck/should_run/EtaExpandLevPoly.hs
testsuite/tests/typecheck/should_run/KindInvariant.script
testsuite/tests/typecheck/should_run/T11120.hs
testsuite/tests/typecheck/should_run/T12809.hs
testsuite/tests/typecheck/should_run/T13435.hs
testsuite/tests/typecheck/should_run/TypeOf.hs
testsuite/tests/typecheck/should_run/TypeRep.hs
testsuite/tests/unboxedsums/sum_rr.hs