[commit: ghc] wip/T15809: WIP on using level numbers for generalisation (2828e18)

git at git.haskell.org git at git.haskell.org
Fri Nov 23 17:34:21 UTC 2018


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

On branch  : wip/T15809
Link       : http://ghc.haskell.org/trac/ghc/changeset/2828e1857fb5eb41fa820220ac8cedeac3d05727/ghc

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

commit 2828e1857fb5eb41fa820220ac8cedeac3d05727
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Oct 31 08:40:40 2018 +0000

    WIP on using level numbers for generalisation
    
    This mostly works.  So far I simply have a WARNING
    in quantifyTyVars which fires if the two methods
    (old "global-tyvars" and new "level-numbers") give
    different answers.
    
    Some modest but important refactoring along the way.
    
    Main thing that is still wrong: in instance declarations
    we are not skoelmising.
    
    Here's a partial patch to TcInstDcls, that /doesn't/ yet work
    
             -- Next, process any associated types.
             ; traceTc "tcLocalInstDecl" (ppr poly_ty)
    -        ; tyfam_insts0  <- scopeTyVars InstSkol tyvars $
    -                           mapAndRecoverM (tcTyFamInstDecl mb_info) ats
    -        ; datafam_stuff <- scopeTyVars InstSkol tyvars $
    -                           mapAndRecoverM (tcDataFamInstDecl mb_info) adts
    +        ; (_subst, skol_tvs) <- tcInstSkolTyVars tyvars
    +        ; (tyfam_insts0, datafam_stuff)
    +             <- tcExtendNameTyVarEnv (map tyVarName tyvars `zip` skol_tvs) $
    +                do { tfs <- mapAndRecoverM (tcTyFamInstDecl mb_info)   ats
    +                   ; dfs <- mapAndRecoverM (tcDataFamInstDecl mb_info) adts
    +                   ; return (tfs, dfs) }
             ; let (datafam_insts, m_deriv_infos) = unzip datafam_stuff


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

2828e1857fb5eb41fa820220ac8cedeac3d05727
 compiler/typecheck/TcHsType.hs     | 95 ++++++++++++++++++++++++------------
 compiler/typecheck/TcMType.hs      | 99 ++++++++++++++++++++++++++------------
 compiler/typecheck/TcSimplify.hs   | 19 +++++---
 compiler/typecheck/TcTyClsDecls.hs | 86 ++++++++++++++++-----------------
 compiler/typecheck/TcValidity.hs   | 12 ++---
 5 files changed, 192 insertions(+), 119 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 2828e1857fb5eb41fa820220ac8cedeac3d05727


More information about the ghc-commits mailing list