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

git at git.haskell.org git at git.haskell.org
Mon Nov 26 17:48:31 UTC 2018


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

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

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

commit ec716ec4ddbcd74eafa3d9ba87be3e4facc23bdc
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


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

ec716ec4ddbcd74eafa3d9ba87be3e4facc23bdc
 compiler/typecheck/TcHsType.hs     | 95 ++++++++++++++++++++++++------------
 compiler/typecheck/TcMType.hs      | 99 ++++++++++++++++++++++++++------------
 compiler/typecheck/TcSimplify.hs   | 19 +++++---
 compiler/typecheck/TcTyClsDecls.hs | 90 +++++++++++++++++-----------------
 compiler/typecheck/TcValidity.hs   | 12 ++---
 5 files changed, 194 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 ec716ec4ddbcd74eafa3d9ba87be3e4facc23bdc


More information about the ghc-commits mailing list