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

git at git.haskell.org git at git.haskell.org
Mon Nov 19 20:48:46 UTC 2018


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

On branch  : wip/T15809
Link       : http://ghc.haskell.org/trac/ghc/changeset/9ecec6f15172e47e81095d0893b13e6d8fc400a8/ghc

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

commit 9ecec6f15172e47e81095d0893b13e6d8fc400a8
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


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

9ecec6f15172e47e81095d0893b13e6d8fc400a8
 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 9ecec6f15172e47e81095d0893b13e6d8fc400a8


More information about the ghc-commits mailing list