X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypes%2FInstEnv.lhs;h=49b49b83e15b80af8dd974827030fe6d1122c6df;hb=b4bf17afb2cf8b6e361cb8715f0de989e939ed1b;hp=b3d8dccc536d300798ec5f6276d460db40d405a6;hpb=72462499b891d5779c19f3bda03f96e24f9554ae;p=ghc-hetmet.git diff --git a/compiler/types/InstEnv.lhs b/compiler/types/InstEnv.lhs index b3d8dcc..49b49b8 100644 --- a/compiler/types/InstEnv.lhs +++ b/compiler/types/InstEnv.lhs @@ -59,7 +59,7 @@ data Instance -- INVARIANT: is_dfun Id has type -- forall is_tvs. (...) => is_cls is_tys - , is_dfun :: DFunId + , is_dfun :: DFunId -- See Note [Haddock assumptions] , is_flag :: OverlapFlag -- See detailed comments with -- the decl of BasicTypes.OverlapFlag } @@ -99,7 +99,20 @@ However, note that: (This is so that we can use the matching substitution to instantiate the dfun's context.) +Note [Haddock assumptions] +~~~~~~~~~~~~~~~~~~~~~~~~~~ +For normal user-written instances, Haddock relies on + * the SrcSpan of + * the Name of + * the is_dfun of + * an Instance + +being equal to + + * the SrcSpan of + * the instance head type of + * the InstDecl used to construct the Instance. \begin{code} instanceDFunId :: Instance -> DFunId