summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Eisenberg <eir@cis.upenn.edu>2014-03-21 17:22:10 -0400
committerRichard Eisenberg <eir@cis.upenn.edu>2014-03-22 18:38:41 -0400
commit9b38f6a12c0a9e932ed4be4758d90556f868f6bf (patch)
treedef00c22b4103ece4cc8c893d2ab1a6d94ab7030
parentbe2e0e88d7ddd33eef8277c8d67f0b0f3e2874be (diff)
downloadhaskell-9b38f6a12c0a9e932ed4be4758d90556f868f6bf.tar.gz
Comments only -- clarifying Notes around compatibility.
-rw-r--r--compiler/iface/MkIface.lhs2
-rw-r--r--compiler/types/CoAxiom.lhs1
-rw-r--r--compiler/types/FamInstEnv.lhs4
3 files changed, 5 insertions, 2 deletions
diff --git a/compiler/iface/MkIface.lhs b/compiler/iface/MkIface.lhs
index 51df08c44c..bb51cdae9d 100644
--- a/compiler/iface/MkIface.lhs
+++ b/compiler/iface/MkIface.lhs
@@ -1525,7 +1525,7 @@ coAxiomToIfaceDecl ax@(CoAxiom { co_ax_tc = tycon, co_ax_branches = branches
-- 2nd parameter is the list of branch LHSs, for conversion from incompatible branches
-- to incompatible indices
--- See [Storing compatibility] in CoAxiom
+-- See Note [Storing compatibility] in CoAxiom
coAxBranchToIfaceBranch :: TidyEnv -> [[Type]] -> CoAxBranch -> IfaceAxBranch
coAxBranchToIfaceBranch env0 lhs_s
branch@(CoAxBranch { cab_incomps = incomps })
diff --git a/compiler/types/CoAxiom.lhs b/compiler/types/CoAxiom.lhs
index a0a4974831..d6122b21e6 100644
--- a/compiler/types/CoAxiom.lhs
+++ b/compiler/types/CoAxiom.lhs
@@ -327,6 +327,7 @@ isImplicitCoAxiom = co_ax_implicit
coAxBranchIncomps :: CoAxBranch -> [CoAxBranch]
coAxBranchIncomps = cab_incomps
+-- See Note [Compatibility checking] in FamInstEnv
placeHolderIncomps :: [CoAxBranch]
placeHolderIncomps = panic "placeHolderIncomps"
diff --git a/compiler/types/FamInstEnv.lhs b/compiler/types/FamInstEnv.lhs
index c17668bbb5..0421f48a58 100644
--- a/compiler/types/FamInstEnv.lhs
+++ b/compiler/types/FamInstEnv.lhs
@@ -439,7 +439,7 @@ only when we can be sure that 'a' is not Int.
To achieve this, after finding a possible match within the equations, we have to
go back to all previous equations and check that, under the
substitution induced by the match, other branches are surely apart. (See
-[Apartness].) This is similar to what happens with class
+Note [Apartness].) This is similar to what happens with class
instance selection, when we need to guarantee that there is only a match and
no unifiers. The exact algorithm is different here because the the
potentially-overlapping group is closed.
@@ -475,6 +475,7 @@ irrelevant (clause 1 of compatible) or benign (clause 2 of compatible).
\begin{code}
+-- See Note [Compatibility]
compatibleBranches :: CoAxBranch -> CoAxBranch -> Bool
compatibleBranches (CoAxBranch { cab_lhs = lhs1, cab_rhs = rhs1 })
(CoAxBranch { cab_lhs = lhs2, cab_rhs = rhs2 })
@@ -487,6 +488,7 @@ compatibleBranches (CoAxBranch { cab_lhs = lhs1, cab_rhs = rhs1 })
-- takes a CoAxiom with unknown branch incompatibilities and computes
-- the compatibilities
+-- See Note [Storing compatibility] in CoAxiom
computeAxiomIncomps :: CoAxiom br -> CoAxiom br
computeAxiomIncomps ax@(CoAxiom { co_ax_branches = branches })
= ax { co_ax_branches = go [] branches }