Changes between Version 20 and Version 21 of TypeFunctionsTypeChecking

Aug 18, 2006 8:59:47 PM (9 years ago)



  • TypeFunctionsTypeChecking

    v20 v21  
    5050=== Representation of data instances ===
    52 When building the `TyCon` representing a `data instance`, we need to derive a new name from the family name.  To this end, we add a new Boolean argument to `BuildTyCl.buildAlgTyCon` that indicates that a new name has to be generated and registered.  We currently use `newImplicitBinder`.
     52There are three (inter-linked) aspects to the representation of data/newtype instances: (1) the representation of the `TyCon` generated from an instance, (2) the representation of the `DataCon`s for the variants of the instance, and the (3) equality axiom connecting the indexed family type with the representation of Item (1).
     54==== The `TyCon` of an instance ====
     56When building the `TyCon` for the representation type of a `data instance`, we need to derive a new (internal) name for that representation `TyCon` from the family name.  This is done by `BuildTyCl.buildAlgTyCon`, which gets an additional argument `mb_family :: Maybe TyCon` that gives the family type constructor if we are building a `TyCon` for an instance.  In that case, `buildAlgTyCon` generates a new name with the help of `newImplicitBinder` and fills the new field `algTcParent` with type
     58data AlgTyConParent = NoParentTyCon
     59                    | ClassTyCon    Class
     60                    | FamilyTyCon   TyCon
     62which 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` as we still do not want to represent class parent information in interfaces.
     64==== The `DataCon`s of the variants of an instance ====
     66==== The equality axiom identifying family instance and representation type ====
    5468=== Representation of type equation axioms ===