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

git at git.haskell.org git at git.haskell.org
Fri Oct 26 16:18:29 UTC 2018


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

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

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

commit a91bf67d3b8e10e433f8bda356400a03c80baa92
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Oct 26 17:11:07 2018 +0100

    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


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

a91bf67d3b8e10e433f8bda356400a03c80baa92
 compiler/typecheck/TcHsType.hs     |  93 +++++++++++++++++++++-----------
 compiler/typecheck/TcMType.hs      | 107 +++++++++++++++++++++++++------------
 compiler/typecheck/TcSimplify.hs   |  19 ++++---
 compiler/typecheck/TcTyClsDecls.hs |  86 ++++++++++++++---------------
 compiler/typecheck/TcValidity.hs   |  12 ++---
 5 files changed, 196 insertions(+), 121 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 a91bf67d3b8e10e433f8bda356400a03c80baa92


More information about the ghc-commits mailing list