summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2015-08-07 12:32:48 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2015-08-07 12:34:12 +0100
commita192d6b46d86141b7f184df219b36c13c420e6ef (patch)
tree1bd3281aa8f5d533cd817fc65e201c9816dbc144
parent79e0a10e541724713f1149c468ba966b7fc819d3 (diff)
downloadhaskell-a192d6b46d86141b7f184df219b36c13c420e6ef.tar.gz
Comments only
-rw-r--r--compiler/typecheck/TcCanonical.hs4
-rw-r--r--compiler/typecheck/TcFlatten.hs9
-rw-r--r--compiler/typecheck/TcSMonad.hs2
3 files changed, 8 insertions, 7 deletions
diff --git a/compiler/typecheck/TcCanonical.hs b/compiler/typecheck/TcCanonical.hs
index f37ad3e6dc..ed3955d0f3 100644
--- a/compiler/typecheck/TcCanonical.hs
+++ b/compiler/typecheck/TcCanonical.hs
@@ -1128,7 +1128,7 @@ canEqTyVarTyVar ev eq_rel swapped tv1 tv2
| incompat_kind = incompatibleKind ev xi1 k1 xi2 k2
-- We don't do this any more
--- See Note [Orientation of equalities with fmvs] in TcSMonad
+-- See Note [Orientation of equalities with fmvs] in TcFlatten
-- | isFmvTyVar tv1 = do_fmv swapped tv1 xi1 xi2 co1 co2
-- | isFmvTyVar tv2 = do_fmv (flipSwap swapped) tv2 xi2 xi1 co2 co1
@@ -1159,7 +1159,7 @@ canEqTyVarTyVar ev eq_rel swapped tv1 tv2
, cc_rhs = xi2, cc_eq_rel = eq_rel })
{- We don't do this any more
- See Note [Orientation of equalities with fmvs] in TcSMonad
+ See Note [Orientation of equalities with fmvs] in TcFlatten
-- tv1 is the flatten meta-var
do_fmv swapped tv1 xi1 xi2 co1 co2
| same_kind
diff --git a/compiler/typecheck/TcFlatten.hs b/compiler/typecheck/TcFlatten.hs
index 9df06908dd..052c158cfc 100644
--- a/compiler/typecheck/TcFlatten.hs
+++ b/compiler/typecheck/TcFlatten.hs
@@ -264,8 +264,9 @@ This is a real dilemma. CURRENT SOLUTION:
CFunEqCan F fmv ~ fmv, because fmv := F fmv would make an ininite
type. Instead we unify fmv:=a, AND record that we have done so.
- If any such "non-CFunEqCan unifications" take place, iterate the
- entire process. This is done by the 'go' loop in solveSimpleWanteds.
+ If any such "non-CFunEqCan unifications" take place (in
+ unflatten_eq in TcFlatten.unflatten) iterate the entire process.
+ This is done by the 'go' loop in solveSimpleWanteds.
This story does not feel right but it's the best I can do; and the
iteration only happens in pretty obscure circumstances.
@@ -1368,7 +1369,7 @@ unflatten tv_eqs funeqs
; funeqs <- foldrBagM (unflatten_funeq dflags) emptyCts funeqs
; traceTcS "Unflattening 1" $ braces (pprCts funeqs)
- -- Step 2: unify the irreds, if possible
+ -- Step 2: unify the tv_eqs, if possible
; tv_eqs <- foldrBagM (unflatten_eq dflags tclvl) emptyCts tv_eqs
; traceTcS "Unflattening 2" $ braces (pprCts tv_eqs)
@@ -1376,7 +1377,7 @@ unflatten tv_eqs funeqs
; funeqs <- mapBagM finalise_funeq funeqs
; traceTcS "Unflattening 3" $ braces (pprCts funeqs)
- -- Step 4: remove any irreds that look like ty ~ ty
+ -- Step 4: remove any tv_eqs that look like ty ~ ty
; tv_eqs <- foldrBagM finalise_eq emptyCts tv_eqs
; let all_flat = tv_eqs `andCts` funeqs
diff --git a/compiler/typecheck/TcSMonad.hs b/compiler/typecheck/TcSMonad.hs
index cd3d3c977b..3721975d3e 100644
--- a/compiler/typecheck/TcSMonad.hs
+++ b/compiler/typecheck/TcSMonad.hs
@@ -994,7 +994,7 @@ Note [Examples of how the inert_model helps completeness]
[D] d4: fmv2 ~ a
At this point we are stuck so we unflatten this set:
- See Note [Orientation of equalities with fmvs]
+ See Note [Orientation of equalities with fmvs] in TcFlatten
[W] w1: F fmv2 ~ fmv1
[W] w2: UnF fmv1 ~ fmv2
[W] w5: fmv1 ~ fsk1