Changes between Version 34 and Version 35 of TypeFunctionsTypeChecking


Ignore:
Timestamp:
Sep 5, 2006 9:03:22 PM (8 years ago)
Author:
chak
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TypeFunctionsTypeChecking

    v34 v35  
    6868                                    [Type]    -- instance types 
    6969                                    TyCon     -- representation coercion 
     70                                    Int       -- unique (module-wide) index 
    7071}}} 
    7172which 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 
     
    7475}}} 
    7576the instance types are `[(a, b), v]`. 
     77 
     78The 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). 
    7679 
    7780NB: 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`.