Changes between Version 35 and Version 36 of TypeFunctionsTypeChecking
- Sep 8, 2006 7:47:13 PM (8 years ago)
v35 v36 68 68 [Type] -- instance types 69 69 TyCon -- representation coercion 70 Int -- unique (module-wide) index 71 70 }}} 72 71 which is a generalisation of the old field `algTcClass` of the internal representation for datatypes, `TyCon.AlgTyCon`. In contrast to the old `algTcClass` field, the new field also appears in `IfaceSyn.IfaceDecl`. However, it does so as `Maybe (IfaceTyCon, [IfaceType])` as we still do not want to represent class parent information in interfaces and we only record the family tycon and instance types in interfaces, not the coercion. (The latter is implicitly reconstructed upon loading an interface.) The ''instance types'' are the type indexes at which the data constructor has been declared; e.g., given the declaration … … 75 74 }}} 76 75 the instance types are `[(a, b), v]`. 77 78 The unique index is necessary to generate unqiue names for the derived tycon and coercion of the instance in a way that can be deterministically replicated when slurping in an interface file containing the corresponding interface declarations (which leave the derived tycon and coercion implicit). 79 76 80 77 NB: The type argument variables of the representation tycon are the free variables of the instance types; i.e., the representation data type is an ordinary data type, it is neither indexed nor open. The only give away of its special purpose is the value in `algTcParent`.