Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : ghc-7.2
http://hackage.haskell.org/trac/ghc/changeset/a1068ac1eb097ba857282ca47f9e1004dba30197 >--------------------------------------------------------------- commit a1068ac1eb097ba857282ca47f9e1004dba30197 Author: Simon Marlow <[email protected]> Date: Wed Jun 1 11:25:12 2011 +0100 remove out of date comment about instance versioning, replace it with a link to the Commentary where the current story is described. >--------------------------------------------------------------- compiler/iface/IfaceSyn.lhs | 38 +------------------------------------- 1 files changed, 1 insertions(+), 37 deletions(-) diff --git a/compiler/iface/IfaceSyn.lhs b/compiler/iface/IfaceSyn.lhs index e03bc29..2204c9a 100644 --- a/compiler/iface/IfaceSyn.lhs +++ b/compiler/iface/IfaceSyn.lhs @@ -314,43 +314,7 @@ defined.) Note [Versioning of instances] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Now consider versioning. If we *use* an instance decl in one compilation, -we'll depend on the dfun id for that instance, so we'll recompile if it changes. -But suppose we *don't* (currently) use an instance! We must recompile if -the instance is changed in such a way that it becomes important. (This would -only matter with overlapping instances, else the importing module wouldn't have -compiled before and the recompilation check is irrelevant.) - -The is_orph field is set to (Just n) if the instance is not an orphan. -The 'n' is *any* of the locally-defined names mentioned anywhere in the -instance head. This name is used for versioning; the instance decl is -considered part of the defn of this 'n'. - -I'm worried about whether this works right if we pick a name from -a functionally-dependent part of the instance decl. E.g. - - module M where { class C a b | a -> b } - -and suppose we are compiling module X: - - module X where - import M - data S = ... - data T = ... - instance C S T where ... - -If we base the instance version on T, I'm worried that changing S to S' -would change T's version, but not S or S'. But an importing module might -not depend on T, and so might not be recompiled even though the new instance -(C S' T) might be relevant. I have not been able to make a concrete example, -and it seems deeply obscure, so I'm going to leave it for now. - - -Note [Versioning of rules] -~~~~~~~~~~~~~~~~~~~~~~~~~~ -A rule that is not an orphan has an ifRuleOrph field of (Just n), where n -appears on the LHS of the rule; any change in the rule changes the version of n. - +See [http://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/RecompilationAvoidance#Instances] \begin{code} -- ----------------------------------------------------------------------------- _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
