[commit: ghc] wip/T15809: WIP on using level numbers for generalisation (9d70d5a)
git at git.haskell.org
git at git.haskell.org
Fri Nov 2 18:11:05 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/T15809
Link : http://ghc.haskell.org/trac/ghc/changeset/9d70d5a8d1a189456537213b47b7a1c873308ec7/ghc
>---------------------------------------------------------------
commit 9d70d5a8d1a189456537213b47b7a1c873308ec7
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
>---------------------------------------------------------------
9d70d5a8d1a189456537213b47b7a1c873308ec7
compiler/typecheck/TcHsType.hs | 93 +++++++++++++++++++++++------------
compiler/typecheck/TcMType.hs | 99 ++++++++++++++++++++++++++------------
compiler/typecheck/TcSimplify.hs | 19 +++++---
compiler/typecheck/TcTyClsDecls.hs | 86 ++++++++++++++++-----------------
compiler/typecheck/TcValidity.hs | 12 ++---
5 files changed, 191 insertions(+), 118 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 9d70d5a8d1a189456537213b47b7a1c873308ec7
More information about the ghc-commits
mailing list