diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2015-07-23 08:34:10 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2015-07-23 08:34:36 +0100 |
commit | 985127510685c3e7ed462260bd69d2e6557430f4 (patch) | |
tree | 8316649ad14a62b4af3b88fa2857db068936be4d /compiler | |
parent | 5c3fc921aeeeec392a89914783b2be9ea3dade27 (diff) | |
download | haskell-985127510685c3e7ed462260bd69d2e6557430f4.tar.gz |
Comments only
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/typecheck/FunDeps.hs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/typecheck/FunDeps.hs b/compiler/typecheck/FunDeps.hs index 9d4ef1c72e..997dcc0019 100644 --- a/compiler/typecheck/FunDeps.hs +++ b/compiler/typecheck/FunDeps.hs @@ -225,12 +225,18 @@ checkClsFD :: FunDep TyVar -> [TyVar] -- One functional dependency f -> ClsInst -- An instance template -> TyVarSet -> [Type] -> [Maybe Name] -- Arguments of this (C tys) predicate -- TyVarSet are extra tyvars that can be instantiated - -> [([TyVar], [Pair Type])] + -> [([TyVar], [Pair Type])] -- Empty or singleton checkClsFD fd clas_tvs (ClsInst { is_tvs = qtvs, is_tys = tys_inst, is_tcs = rough_tcs_inst }) extra_qtvs tys_actual rough_tcs_actual +-- Compare instance {a,b} C sx sp sy sq +-- with {c,d,e} C tx tp ty tq +-- for fundep (x,y -> p,q) from class (C x p y q) +-- If (sx,sy) unifies with (tx,ty), take the subst S +-- + -- 'qtvs' are the quantified type variables, the ones which an be instantiated -- to make the types match. For example, given -- class C a b | a->b where ... |