[commit: ghc] wip/heapprof001-fragile: Visible dependent quantification (c26d299)

git at git.haskell.org git at git.haskell.org
Sat Mar 2 14:51:52 UTC 2019


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/heapprof001-fragile
Link       : http://ghc.haskell.org/trac/ghc/changeset/c26d299dc422f43b8c37da4b26da2067eedcbae8/ghc

>---------------------------------------------------------------

commit c26d299dc422f43b8c37da4b26da2067eedcbae8
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date:   Mon Dec 17 20:54:36 2018 -0500

    Visible dependent quantification
    
    This implements GHC proposal 35
    (https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0035-forall-arrow.rst)
    by adding the ability to write kinds with
    visible dependent quantification (VDQ).
    
    Most of the work for supporting VDQ was actually done _before_ this
    patch. That is, GHC has been able to reason about kinds with VDQ for
    some time, but it lacked the ability to let programmers directly
    write these kinds in the source syntax. This patch is primarly about
    exposing this ability, by:
    
    * Changing `HsForAllTy` to add an additional field of type
      `ForallVisFlag` to distinguish between invisible `forall`s (i.e,
      with dots) and visible `forall`s (i.e., with arrows)
    * Changing `Parser.y` accordingly
    
    The rest of the patch mostly concerns adding validity checking to
    ensure that VDQ is never used in the type of a term (as permitting
    this would require full-spectrum dependent types). This is
    accomplished by:
    
    * Adding a `vdqAllowed` predicate to `TcValidity`.
    * Introducing `splitLHsSigmaTyInvis`, a variant of `splitLHsSigmaTy`
      that only splits invisible `forall`s. This function is used in
      certain places (e.g., in instance declarations) to ensure that GHC
      doesn't try to split visible `forall`s (e.g., if it tried splitting
      `instance forall a -> Show (Blah a)`, then GHC would mistakenly
      allow that declaration!)
    
    This also updates Template Haskell by introducing a new `ForallVisT`
    constructor to `Type`.
    
    Fixes #16326. Also fixes #15658 by documenting this feature in the
    users' guide.


>---------------------------------------------------------------

c26d299dc422f43b8c37da4b26da2067eedcbae8
 compiler/basicTypes/Var.hs                         |  57 +++++++--
 compiler/deSugar/DsMeta.hs                         |  17 ++-
 compiler/hieFile/HieAst.hs                         |   2 +-
 compiler/hsSyn/Convert.hs                          |  20 ++-
 compiler/hsSyn/HsDecls.hs                          |   6 +-
 compiler/hsSyn/HsTypes.hs                          | 138 +++++++++++++++++----
 compiler/hsSyn/HsUtils.hs                          |   7 +-
 compiler/iface/IfaceType.hs                        |   3 +-
 compiler/parser/Parser.y                           |  22 +++-
 compiler/parser/RdrHsSyn.hs                        |   2 +-
 compiler/prelude/THNames.hs                        | 108 ++++++++--------
 compiler/prelude/TysWiredIn.hs                     |   1 -
 compiler/rename/RnTypes.hs                         |  15 ++-
 compiler/typecheck/TcDeriv.hs                      |   3 +-
 compiler/typecheck/TcHsType.hs                     |   8 +-
 compiler/typecheck/TcRnDriver.hs                   |   3 +-
 compiler/typecheck/TcSigs.hs                       |   4 +-
 compiler/typecheck/TcSplice.hs                     |  24 ++--
 compiler/typecheck/TcType.hs                       |  14 ++-
 compiler/typecheck/TcValidity.hs                   |  69 ++++++++++-
 compiler/types/TyCoRep.hs                          |   2 +-
 compiler/types/Type.hs                             |  16 ++-
 docs/users_guide/8.10.1-notes.rst                  |  10 ++
 docs/users_guide/glasgow_exts.rst                  |  49 ++++++++
 docs/users_guide/index.rst                         |   1 +
 .../template-haskell/Language/Haskell/TH/Lib.hs    |   8 +-
 .../Language/Haskell/TH/Lib/Internal.hs            |   3 +
 .../template-haskell/Language/Haskell/TH/Ppr.hs    |  22 +++-
 .../template-haskell/Language/Haskell/TH/Syntax.hs |   1 +
 libraries/template-haskell/changelog.md            |   3 +
 .../dependent/should_compile/T16326_Compile1.hs    |  40 ++++++
 .../dependent/should_compile/T16326_Compile2.hs    |  13 ++
 testsuite/tests/dependent/should_compile/all.T     |   2 +
 .../tests/dependent/should_fail/T15859.stderr      |  12 +-
 .../tests/dependent/should_fail/T16326_Fail1.hs    |  10 ++
 .../dependent/should_fail/T16326_Fail1.stderr      |  13 ++
 .../tests/dependent/should_fail/T16326_Fail10.hs   |  12 ++
 .../dependent/should_fail/T16326_Fail10.stderr     |   7 ++
 .../tests/dependent/should_fail/T16326_Fail11.hs   |  10 ++
 .../dependent/should_fail/T16326_Fail11.stderr     |   7 ++
 .../tests/dependent/should_fail/T16326_Fail12.hs   |   6 +
 .../dependent/should_fail/T16326_Fail12.stderr     |   8 ++
 .../tests/dependent/should_fail/T16326_Fail2.hs    |   6 +
 .../dependent/should_fail/T16326_Fail2.stderr      |   8 ++
 .../tests/dependent/should_fail/T16326_Fail3.hs    |   7 ++
 .../dependent/should_fail/T16326_Fail3.stderr      |   5 +
 .../tests/dependent/should_fail/T16326_Fail4.hs    |   6 +
 .../dependent/should_fail/T16326_Fail4.stderr      |  11 ++
 .../tests/dependent/should_fail/T16326_Fail5.hs    |   8 ++
 .../dependent/should_fail/T16326_Fail5.stderr      |   9 ++
 .../tests/dependent/should_fail/T16326_Fail6.hs    |   9 ++
 .../dependent/should_fail/T16326_Fail6.stderr      |   7 ++
 .../tests/dependent/should_fail/T16326_Fail7.hs    |   8 ++
 .../dependent/should_fail/T16326_Fail7.stderr      |   5 +
 .../tests/dependent/should_fail/T16326_Fail8.hs    |   7 ++
 .../dependent/should_fail/T16326_Fail8.stderr      |   6 +
 .../tests/dependent/should_fail/T16326_Fail9.hs    |  11 ++
 .../dependent/should_fail/T16326_Fail9.stderr      |   8 ++
 testsuite/tests/dependent/should_fail/all.T        |  12 ++
 .../parser/should_compile/DumpRenamedAst.stderr    |   1 +
 testsuite/tests/th/T16326_TH.hs                    |  24 ++++
 testsuite/tests/th/T16326_TH.stderr                |  22 ++++
 testsuite/tests/th/all.T                           |   3 +-
 utils/haddock                                      |   2 +-
 64 files changed, 814 insertions(+), 149 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc c26d299dc422f43b8c37da4b26da2067eedcbae8


More information about the ghc-commits mailing list