projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
957b762
)
Add comments about invariants
author
simonpj@microsoft.com
<unknown>
Thu, 11 Jan 2007 09:10:03 +0000
(09:10 +0000)
committer
simonpj@microsoft.com
<unknown>
Thu, 11 Jan 2007 09:10:03 +0000
(09:10 +0000)
compiler/types/InstEnv.lhs
patch
|
blob
|
history
diff --git
a/compiler/types/InstEnv.lhs
b/compiler/types/InstEnv.lhs
index
b8e10d5
..
7d131d4
100644
(file)
--- a/
compiler/types/InstEnv.lhs
+++ b/
compiler/types/InstEnv.lhs
@@
-54,11
+54,14
@@
data Instance
= Instance { is_cls :: Name -- Class name
-- Used for "rough matching"; see note below
= Instance { is_cls :: Name -- Class name
-- Used for "rough matching"; see note below
+ -- INVARIANT: is_tcs = roughMatchTcs is_tys
, is_tcs :: [Maybe Name] -- Top of type args
-- Used for "proper matching"; see note
, is_tvs :: TyVarSet -- Template tyvars for full match
, is_tys :: [Type] -- Full arg types
, is_tcs :: [Maybe Name] -- Top of type args
-- Used for "proper matching"; see note
, is_tvs :: TyVarSet -- Template tyvars for full match
, is_tys :: [Type] -- Full arg types
+ -- INVARIANT: is_dfun Id has type
+ -- forall is_tvs. (...) => is_cls is_tys
, is_dfun :: DFunId
, is_flag :: OverlapFlag -- See detailed comments with
, is_dfun :: DFunId
, is_flag :: OverlapFlag -- See detailed comments with
@@
-88,7
+91,7
@@
In is_tcs,
The "proper-match" fields
~~~~~~~~~~~~~~~~~~~~~~~~~
The "proper-match" fields
~~~~~~~~~~~~~~~~~~~~~~~~~
-The is_tvs, is_tys fields are simply cahced values, pulled
+The is_tvs, is_tys fields are simply cached values, pulled
out (lazily) from the dfun id. They are cached here simply so
that we don't need to decompose the DFunId each time we want
to match it. The hope is that the fast-match fields mean
out (lazily) from the dfun id. They are cached here simply so
that we don't need to decompose the DFunId each time we want
to match it. The hope is that the fast-match fields mean