[Git][ghc/ghc][master] Use HsTyPats in associated type family defaults

Marge Bot gitlab at gitlab.haskell.org
Wed May 22 20:59:38 UTC 2019



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
6efe04de by Ryan Scott at 2019-05-22T20:56:01Z
Use HsTyPats in associated type family defaults

Associated type family default declarations behave strangely in a
couple of ways:

1. If one tries to bind the type variables with an explicit `forall`,
   the `forall`'d part will simply be ignored. (#16110)
2. One cannot use visible kind application syntax on the left-hand
   sides of associated default equations, unlike every other form
   of type family equation. (#16356)

Both of these issues have a common solution. Instead of using
`LHsQTyVars` to represent the left-hand side arguments of an
associated default equation, we instead use `HsTyPats`, which is what
other forms of type family equations use. In particular, here are
some highlights of this patch:

* `FamEqn` is no longer parameterized by a `pats` type variable, as
  the `feqn_pats` field is now always `HsTyPats`.
* The new design for `FamEqn` in chronicled in
  `Note [Type family instance declarations in HsSyn]`.
* `TyFamDefltEqn` now becomes the same thing as `TyFamInstEqn`. This
  means that many of `TyFamDefltEqn`'s code paths can now reuse the
  code paths for `TyFamInstEqn`, resulting in substantial
  simplifications to various parts of the code dealing with
  associated type family defaults.

Fixes #16110 and #16356.

- - - - -


30 changed files:

- compiler/deSugar/DsMeta.hs
- compiler/hieFile/HieAst.hs
- compiler/hsSyn/Convert.hs
- compiler/hsSyn/HsDecls.hs
- compiler/hsSyn/HsExtension.hs
- compiler/hsSyn/HsInstances.hs
- compiler/parser/RdrHsSyn.hs
- compiler/rename/RnSource.hs
- compiler/typecheck/TcTyClsDecls.hs
- docs/users_guide/8.10.1-notes.rst
- docs/users_guide/glasgow_exts.rst
- + testsuite/tests/indexed-types/should_compile/T16110_Compile.hs
- + testsuite/tests/indexed-types/should_compile/T16356_Compile1.hs
- + testsuite/tests/indexed-types/should_compile/T16356_Compile2.hs
- + testsuite/tests/indexed-types/should_compile/T16356_Compile2.stderr
- testsuite/tests/indexed-types/should_compile/all.T
- testsuite/tests/indexed-types/should_fail/SimpleFail4.stderr
- + testsuite/tests/indexed-types/should_fail/T16110_Fail1.hs
- + testsuite/tests/indexed-types/should_fail/T16110_Fail1.stderr
- + testsuite/tests/indexed-types/should_fail/T16110_Fail2.hs
- + testsuite/tests/indexed-types/should_fail/T16110_Fail2.stderr
- + testsuite/tests/indexed-types/should_fail/T16110_Fail3.hs
- + testsuite/tests/indexed-types/should_fail/T16110_Fail3.stderr
- + testsuite/tests/indexed-types/should_fail/T16356_Fail1.hs
- + testsuite/tests/indexed-types/should_fail/T16356_Fail1.stderr
- + testsuite/tests/indexed-types/should_fail/T16356_Fail2.hs
- + testsuite/tests/indexed-types/should_fail/T16356_Fail2.stderr
- + testsuite/tests/indexed-types/should_fail/T16356_Fail3.hs
- + testsuite/tests/indexed-types/should_fail/T16356_Fail3.stderr
- testsuite/tests/indexed-types/should_fail/all.T


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/6efe04dee3f4c584e0cd043b8424718f0791d1be

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/6efe04dee3f4c584e0cd043b8424718f0791d1be
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/20190522/3e97337b/attachment.html>


More information about the ghc-commits mailing list