[Git][ghc/ghc][wip/T16762] 16 commits: Replace HsImplicitBndrs with HsOuterTyVarBndrs

Simon Peyton Jones gitlab at gitlab.haskell.org
Tue Oct 13 22:45:49 UTC 2020



Simon Peyton Jones pushed to branch wip/T16762 at Glasgow Haskell Compiler / GHC


Commits:
f165f338 by Ryan Scott at 2020-10-13T09:42:14+01:00
Replace HsImplicitBndrs with HsOuterTyVarBndrs

This refactors the GHC AST to remove `HsImplicitBndrs` and replace it with
`HsOuterTyVarBndrs`, a type which records whether the outermost quantification
in a type is explicit (i.e., with an outermost, invisible `forall`) or
implicit. As a result of this refactoring, it is now evident in the AST where
the `forall`-or-nothing rule applies: it's all the places that use
`HsOuterTyVarBndrs`. See the revamped `Note [forall-or-nothing rule]` in
`GHC.Hs.Type` (previously in `GHC.Rename.HsType`).

Moreover, the places where `ScopedTypeVariables` brings lexically scoped type
variables into scope are a subset of the places that adhere to the
`forall`-or-nothing rule, so this also makes places that interact with
`ScopedTypeVariables` easier to find. See the revamped
`Note [Lexically scoped type variables]` in `GHC.Hs.Type` (previously in
`GHC.Tc.Gen.Sig`).

`HsOuterTyVarBndrs` are used in type signatures (see `HsOuterSigTyVarBndrs`)
and type family equations (see `HsOuterFamEqnTyVarBndrs`). The main difference
between the former and the latter is that the former cares about specificity
but the latter does not.

There are a number of knock-on consequences:

* There is now a dedicated `HsSigType` type, which is the combination of
  `HsOuterSigTyVarBndrs` and `HsType`. `LHsSigType` is now an alias for an
  `XRec` of `HsSigType`.
* TODO RGS: Describe typechecker changes

Fixes #16762. Bumps the Haddock submodule.

Co-authored-by: Simon Peyton Jones <simonpj at microsoft.com>

- - - - -
22e49693 by Simon Peyton Jones at 2020-10-13T09:42:15+01:00
Wibbbles

- - - - -
2e84c96e by Simon Peyton Jones at 2020-10-13T09:42:15+01:00
More wibbles

- - - - -
40a74cdc by Simon Peyton Jones at 2020-10-13T09:42:15+01:00
More wibbles

- - - - -
cd974c8a by Simon Peyton Jones at 2020-10-13T09:42:15+01:00
More wibbles --- getting there

- - - - -
d4013d21 by Ryan Scott at 2020-10-13T09:54:15+01:00
Push through some Haddock changes, disable warnings in GHC.Iface.Ext.Ast for now

- - - - -
c3bed6a2 by Simon Peyton Jones at 2020-10-13T09:54:15+01:00
More wibbles

- - - - -
396fce54 by Ryan Scott at 2020-10-13T09:54:17+01:00
Use TTG in HsOuterTyVarBndrs

- - - - -
450f3981 by Ryan Scott at 2020-10-13T09:54:18+01:00
Add some documentation, minor code cleanup

- - - - -
10cca24b by Richard Eisenberg at 2020-10-13T09:54:18+01:00
Skolemise PatSyns

- - - - -
08e61415 by Richard Eisenberg at 2020-10-13T09:54:18+01:00
Don't freshen when skolemising

- - - - -
1805c836 by Simon Peyton Jones at 2020-10-13T09:54:18+01:00
Wibbles from Simon

- - - - -
be365ada by Richard Eisenberg at 2020-10-13T09:54:18+01:00
Still freshen existentials, though.

- - - - -
fd32885a by Simon Peyton Jones at 2020-10-13T23:31:51+01:00
Yet more wibbles

- - - - -
f34e6cfb by Ryan Scott at 2020-10-13T23:44:31+01:00
Accept new DumpRenamedAst stderr

- - - - -
32447043 by Ryan Scott at 2020-10-13T23:45:04+01:00
Fix a PolyKinds buglet

- - - - -


20 changed files:

- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Extension.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Docs.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Tc/Deriv.hs
- compiler/GHC/Tc/Deriv/Generate.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Gen/Bind.hs
- compiler/GHC/Tc/Gen/Head.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/458da7dbd491bb21cf6a884d454f79ee2a97a5bd...324470433405fc434b27cf2ed2ff4d00242f1cac

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/458da7dbd491bb21cf6a884d454f79ee2a97a5bd...324470433405fc434b27cf2ed2ff4d00242f1cac
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201013/557a0958/attachment.html>


More information about the ghc-commits mailing list