[commit: ghc] wip/exp-types: Refactor the typechecker to use ExpTypes. (1fa8452)

git at git.haskell.org git at git.haskell.org
Tue Jan 26 20:09:16 UTC 2016


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

On branch  : wip/exp-types
Link       : http://ghc.haskell.org/trac/ghc/changeset/1fa8452ba809c24b614c28f7703aad9b0a6118df/ghc

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

commit 1fa8452ba809c24b614c28f7703aad9b0a6118df
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date:   Wed Jan 13 23:29:17 2016 -0500

    Refactor the typechecker to use ExpTypes.
    
    The idea here is described in [wiki:Typechecker]. Briefly,
    this refactor keeps solid track of "synthesis" mode vs
    "checking" in GHC's bidirectional type-checking algorithm.
    When in synthesis mode, the expected type is just an IORef
    to write to.
    
    In addition, this patch does a significant reworking of
    RebindableSyntax, allowing much more freedom in the types
    of the rebindable operators. For example, we can now have
    `negate :: Int -> Bool` and
    `(>>=) :: m a -> (forall x. a x -> m b) -> m b`. The magic
    is in tcSyntaxOp.
    
    This addresses tickets #11397, #11452, and #11458.
    
    Tests:
      typecheck/should_compile/{RebindHR,RebindNegate,T11397,T11458}
      th/T11452


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

1fa8452ba809c24b614c28f7703aad9b0a6118df
 compiler/deSugar/Check.hs                          | 160 +++----
 compiler/deSugar/Coverage.hs                       |  32 +-
 compiler/deSugar/DsArrows.hs                       |  13 +-
 compiler/deSugar/DsExpr.hs                         |  61 +--
 compiler/deSugar/DsExpr.hs-boot                    |   3 +-
 compiler/deSugar/DsGRHSs.hs                        |   2 +-
 compiler/deSugar/DsListComp.hs                     |  59 ++-
 compiler/deSugar/DsMeta.hs                         |  10 +-
 compiler/deSugar/DsUtils.hs                        |  10 +-
 compiler/deSugar/Match.hs                          |  32 +-
 compiler/deSugar/MatchLit.hs                       |  52 +--
 compiler/deSugar/PmExpr.hs                         |   5 +-
 compiler/ghci/RtClosureInspect.hs                  |   4 -
 compiler/hsSyn/Convert.hs                          |   2 +-
 compiler/hsSyn/HsExpr.hs                           |  74 +++-
 compiler/hsSyn/HsExpr.hs-boot                      |   5 +-
 compiler/hsSyn/HsLit.hs                            |   6 +-
 compiler/hsSyn/HsPat.hs                            |  16 +-
 compiler/hsSyn/HsUtils.hs                          |  74 ++--
 compiler/hsSyn/PlaceHolder.hs                      |  23 +-
 compiler/parser/Parser.y                           |   2 +-
 compiler/parser/RdrHsSyn.hs                        |   4 +-
 compiler/rename/RnEnv.hs                           |   8 +-
 compiler/rename/RnExpr.hs                          | 101 +++--
 compiler/rename/RnPat.hs                           |  11 +-
 compiler/typecheck/Inst.hs                         |  55 ++-
 compiler/typecheck/TcArrows.hs                     |  45 +-
 compiler/typecheck/TcBinds.hs                      |  18 +-
 compiler/typecheck/TcErrors.hs                     | 112 +++--
 compiler/typecheck/TcEvidence.hs                   |  38 +-
 compiler/typecheck/TcExpr.hs                       | 472 ++++++++++++++-------
 compiler/typecheck/TcExpr.hs-boot                  |  24 +-
 compiler/typecheck/TcGenDeriv.hs                   |  32 +-
 compiler/typecheck/TcHsSyn.hs                      | 303 ++++++++-----
 compiler/typecheck/TcHsType.hs                     |  11 +-
 compiler/typecheck/TcInstDcls.hs                   |   3 +-
 compiler/typecheck/TcMType.hs                      | 242 +++++++----
 compiler/typecheck/TcMatches.hs                    | 436 ++++++++++---------
 compiler/typecheck/TcMatches.hs-boot               |   4 +-
 compiler/typecheck/TcPat.hs                        | 248 +++++++----
 compiler/typecheck/TcPatSyn.hs                     |  26 +-
 compiler/typecheck/TcRnDriver.hs                   |  17 +-
 compiler/typecheck/TcRnMonad.hs                    |   4 +-
 compiler/typecheck/TcRnTypes.hs                    |  28 +-
 compiler/typecheck/TcRules.hs                      |   3 +-
 compiler/typecheck/TcSplice.hs                     |  41 +-
 compiler/typecheck/TcSplice.hs-boot                |   8 +-
 compiler/typecheck/TcType.hs                       | 111 +++--
 compiler/typecheck/TcUnify.hs                      | 449 +++++++++++++-------
 compiler/typecheck/TcValidity.hs                   |   2 +-
 compiler/utils/MonadUtils.hs                       |   7 +-
 libraries/process                                  |   2 +-
 libraries/transformers                             |   2 +-
 testsuite/tests/ado/ado004.stderr                  |  30 +-
 .../tests/annotations/should_fail/annfail10.stderr |  12 +-
 testsuite/tests/determinism/typecheck/A.hs         |   2 +-
 testsuite/tests/gadt/gadt-escape1.stderr           |  16 +-
 testsuite/tests/gadt/gadt13.stderr                 |  10 +-
 testsuite/tests/gadt/gadt7.stderr                  |  20 +-
 .../tests/ghci.debugger/scripts/break003.stderr    |   2 +-
 .../tests/ghci.debugger/scripts/break003.stdout    |   8 +-
 .../tests/ghci.debugger/scripts/break005.stdout    |   4 +-
 .../tests/ghci.debugger/scripts/break006.stderr    |  12 +-
 .../tests/ghci.debugger/scripts/break006.stdout    |  10 +-
 .../tests/ghci.debugger/scripts/break012.stdout    |   8 +-
 .../tests/ghci.debugger/scripts/hist001.stdout     |  28 +-
 .../tests/ghci.debugger/scripts/print022.stdout    |   4 +-
 testsuite/tests/ghci/scripts/T2182ghci.stderr      |  30 +-
 testsuite/tests/ghci/scripts/T8959.script          |   8 +-
 testsuite/tests/ghci/scripts/T8959.stderr          |  48 +--
 testsuite/tests/ghci/scripts/T8959.stdout          |  11 +-
 .../tests/indexed-types/should_compile/T3484.hs    |   4 +-
 .../tests/indexed-types/should_compile/T4120.hs    |   4 +-
 .../tests/indexed-types/should_compile/T4494.hs    |   3 +-
 .../tests/indexed-types/should_compile/T9090.hs    |   2 +-
 .../tests/indexed-types/should_compile/T9316.hs    |   2 +-
 .../tests/indexed-types/should_fail/T3330a.hs      |   3 +-
 .../tests/indexed-types/should_fail/T5934.stderr   |  11 +-
 .../tests/indexed-types/should_fail/T7788.stderr   |   7 +-
 .../tests/indexed-types/should_fail/T8518.stderr   |  33 +-
 testsuite/tests/module/mod71.stderr                |   6 +-
 .../should_fail/overloadedlistsfail03.hs           |   2 +-
 .../should_fail/overloadedlistsfail03.stderr       |  13 +-
 .../should_fail/overloadedlistsfail05.hs           |   2 +-
 .../should_fail/overloadedlistsfail05.stderr       |  15 +-
 .../tests/parser/should_compile/read014.stderr     |   8 +-
 testsuite/tests/parser/should_fail/T7848.stderr    |  42 +-
 .../partial-sigs/should_compile/T10438.stderr      |  16 +-
 .../partial-sigs/should_compile/T11192.stderr      |  12 +-
 testsuite/tests/polykinds/T7438.stderr             |  16 +-
 testsuite/tests/rebindable/rebindable6.hs          |   5 +-
 testsuite/tests/rebindable/rebindable6.stderr      |  24 +-
 .../tests/rename/should_compile/T3103/GHC/Num.hs   |   9 +
 .../tests/rename/should_compile/T3103/GHC/Word.hs  |   2 +-
 testsuite/tests/th/T11452.hs                       |   6 +
 testsuite/tests/th/T11452.stderr                   |  15 +
 testsuite/tests/th/T2222.stderr                    |   2 +-
 testsuite/tests/th/all.T                           |   1 +
 .../tests/typecheck/should_compile/RebindHR.hs     |  26 ++
 .../tests/typecheck/should_compile/RebindNegate.hs |   9 +
 testsuite/tests/typecheck/should_compile/T11397.hs |  69 +++
 testsuite/tests/typecheck/should_compile/T11458.hs |   5 +
 testsuite/tests/typecheck/should_compile/T2683.hs  |   2 +-
 testsuite/tests/typecheck/should_compile/T7888.hs  |   4 +
 testsuite/tests/typecheck/should_compile/all.T     |   4 +
 .../tests/typecheck/should_compile/tc141.stderr    |   6 +-
 testsuite/tests/typecheck/should_compile/tc158.hs  |   2 +-
 testsuite/tests/typecheck/should_compile/twins.hs  |   2 +-
 .../tests/typecheck/should_fail/FDsFromGivens2.hs  |   1 +
 .../typecheck/should_fail/FDsFromGivens2.stderr    |  26 +-
 .../tests/typecheck/should_fail/T10619.stderr      |   4 +-
 testsuite/tests/typecheck/should_fail/T3613.stderr |   4 +-
 testsuite/tests/typecheck/should_fail/T5570.stderr |   3 +-
 testsuite/tests/typecheck/should_fail/T7453.stderr |  50 +--
 testsuite/tests/typecheck/should_fail/T7734.stderr |  12 +-
 testsuite/tests/typecheck/should_fail/T8603.stderr |   8 +-
 testsuite/tests/typecheck/should_fail/T9109.stderr |  11 +-
 .../tests/typecheck/should_fail/tcfail014.stderr   |   6 +-
 .../tests/typecheck/should_fail/tcfail016.stderr   |  25 +-
 .../tests/typecheck/should_fail/tcfail032.stderr   |   6 +-
 .../tests/typecheck/should_fail/tcfail099.stderr   |   6 +-
 .../tests/typecheck/should_fail/tcfail104.stderr   |  14 +-
 .../tests/typecheck/should_fail/tcfail140.stderr   |   7 +-
 .../tests/typecheck/should_fail/tcfail159.stderr   |   9 +-
 .../tests/typecheck/should_fail/tcfail181.stderr   |   2 +-
 125 files changed, 2649 insertions(+), 1714 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 1fa8452ba809c24b614c28f7703aad9b0a6118df


More information about the ghc-commits mailing list