More explicit foralls (GHC Proposal 0007)
authorMatthew Yacavone <matthew@yacavone.net>
Sat, 27 Oct 2018 18:01:42 +0000 (14:01 -0400)
committerRichard Eisenberg <rae@cs.brynmawr.edu>
Sat, 27 Oct 2018 18:54:56 +0000 (14:54 -0400)
commit512eeb9bb9a81e915bfab25ca16bc87c62252064
tree803e752c6907fdfc89a5f71e6bfda04d7ef86bea
parent23956b2ada690c78a134fe6d149940c777c7efcc
More explicit foralls (GHC Proposal 0007)

Allow the user to explicitly bind type/kind variables in type and data
family instances (including associated instances), closed type family
equations, and RULES pragmas. Follows the specification of GHC
Proposal 0007, also fixes #2600. Advised by Richard Eisenberg.

This modifies the Template Haskell AST -- old code may break!

Other Changes:
- convert HsRule to a record
- make rnHsSigWcType more general
- add repMaybe to DsMeta

Includes submodule update for Haddock.

Test Plan: validate

Reviewers: goldfire, bgamari, alanz

Subscribers: simonpj, RyanGlScott, goldfire, rwbarton,
             thomie, mpickering, carter

GHC Trac Issues: #2600, #14268

Differential Revision: https://phabricator.haskell.org/D4894
90 files changed:
compiler/deSugar/Check.hs
compiler/deSugar/Coverage.hs
compiler/deSugar/Desugar.hs
compiler/deSugar/DsArrows.hs
compiler/deSugar/DsExpr.hs
compiler/deSugar/DsMeta.hs
compiler/deSugar/Match.hs
compiler/deSugar/PmExpr.hs
compiler/hsSyn/Convert.hs
compiler/hsSyn/HsDecls.hs
compiler/hsSyn/HsExpr.hs
compiler/hsSyn/HsExtension.hs
compiler/hsSyn/HsPat.hs
compiler/hsSyn/HsTypes.hs
compiler/hsSyn/HsUtils.hs
compiler/main/HscMain.hs
compiler/main/HscStats.hs
compiler/parser/Parser.y
compiler/parser/RdrHsSyn.hs
compiler/rename/RnBinds.hs
compiler/rename/RnExpr.hs
compiler/rename/RnPat.hs
compiler/rename/RnSource.hs
compiler/rename/RnTypes.hs
compiler/rename/RnUtils.hs
compiler/typecheck/TcAnnotations.hs
compiler/typecheck/TcEnv.hs
compiler/typecheck/TcExpr.hs
compiler/typecheck/TcGenDeriv.hs
compiler/typecheck/TcHsSyn.hs
compiler/typecheck/TcInstDcls.hs
compiler/typecheck/TcPat.hs
compiler/typecheck/TcPatSyn.hs
compiler/typecheck/TcRnDriver.hs
compiler/typecheck/TcRnTypes.hs
compiler/typecheck/TcRules.hs
compiler/typecheck/TcSplice.hs
compiler/typecheck/TcTyClsDecls.hs
docs/users_guide/glasgow_exts.rst
docs/users_guide/using-warnings.rst
ghc/GHCi/UI.hs
libraries/template-haskell/Language/Haskell/TH/Lib.hs
libraries/template-haskell/Language/Haskell/TH/Lib/Internal.hs
libraries/template-haskell/Language/Haskell/TH/Ppr.hs
libraries/template-haskell/Language/Haskell/TH/Syntax.hs
libraries/template-haskell/changelog.md
testsuite/tests/ghc-api/annotations/stringSource.hs
testsuite/tests/ghc-api/annotations/t11430.hs
testsuite/tests/indexed-types/should_compile/ExplicitForAllFams1.hs [new file with mode: 0644]
testsuite/tests/indexed-types/should_compile/ExplicitForAllFams2.hs [new file with mode: 0644]
testsuite/tests/indexed-types/should_compile/ExplicitForAllFams2.stderr [new file with mode: 0644]
testsuite/tests/indexed-types/should_compile/UnusedTyVarWarnings.stderr
testsuite/tests/indexed-types/should_compile/UnusedTyVarWarningsNamedWCs.stderr
testsuite/tests/indexed-types/should_compile/all.T
testsuite/tests/indexed-types/should_fail/ExplicitForAllFams3.hs [new file with mode: 0644]
testsuite/tests/indexed-types/should_fail/ExplicitForAllFams3.stderr [new file with mode: 0644]
testsuite/tests/indexed-types/should_fail/ExplicitForAllFams4a.hs [new file with mode: 0644]
testsuite/tests/indexed-types/should_fail/ExplicitForAllFams4a.stderr [new file with mode: 0644]
testsuite/tests/indexed-types/should_fail/ExplicitForAllFams4b.hs [new file with mode: 0644]
testsuite/tests/indexed-types/should_fail/ExplicitForAllFams4b.stderr [new file with mode: 0644]
testsuite/tests/indexed-types/should_fail/all.T
testsuite/tests/parser/should_compile/DumpParsedAst.stderr
testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
testsuite/tests/parser/should_compile/KindSigs.stderr
testsuite/tests/rename/should_compile/ExplicitForAllRules1.hs [new file with mode: 0644]
testsuite/tests/rename/should_compile/ExplicitForAllRules1.stderr [new file with mode: 0644]
testsuite/tests/rename/should_compile/T2600.hs [new file with mode: 0644]
testsuite/tests/rename/should_compile/T2600.stderr [new file with mode: 0644]
testsuite/tests/rename/should_compile/all.T
testsuite/tests/rename/should_fail/ExplicitForAllRules2.hs [new file with mode: 0644]
testsuite/tests/rename/should_fail/ExplicitForAllRules2.stderr [new file with mode: 0644]
testsuite/tests/rename/should_fail/all.T
testsuite/tests/th/ClosedFam2TH.hs
testsuite/tests/th/T12503.hs
testsuite/tests/th/T12646.stderr
testsuite/tests/th/T13618.hs
testsuite/tests/th/T5886a.hs
testsuite/tests/th/T6018th.hs
testsuite/tests/th/T6018th.stderr
testsuite/tests/th/T7532a.hs
testsuite/tests/th/T8884.stderr
testsuite/tests/th/T8953.stderr
testsuite/tests/th/TH_ExplicitForAllRules.hs [new file with mode: 0644]
testsuite/tests/th/TH_ExplicitForAllRules.stdout [new file with mode: 0644]
testsuite/tests/th/TH_ExplicitForAllRules_a.hs [new file with mode: 0644]
testsuite/tests/th/TH_reifyExplicitForAllFams.hs [new file with mode: 0644]
testsuite/tests/th/TH_reifyExplicitForAllFams.stderr [new file with mode: 0644]
testsuite/tests/th/all.T
utils/ghctags/Main.hs
utils/haddock