Changes between Version 1 and Version 2 of IntermediateTypes


Ignore:
Timestamp:
Aug 4, 2006 10:59:22 AM (9 years ago)
Author:
guest
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • IntermediateTypes

    v1 v2  
    1 === Notes on the FC-based intermediate language === 
     1= Notes on the FC-based intermediate language = 
    22 
    33These notes describe the new intermediate language for GHC.  The 
     
    2626 
    2727 
    28 = Type Variables = 
     28=== Type Variables === 
    2929 
    3030Type variables, of type Var, and associated construction and 
     
    3838variable. 
    3939 
    40 = Type Constructors = 
     40=== Type Constructors === 
    4141 
    4242Type constructors, of datatype !TyCon, are defined in the !TyCon module 
     
    4545intermediate language type system are:  
    4646   
    47  * !AlgTyCon, which are for tycons for datatypes and newtypes and have a 
    48   field of type !AlgTyConRhs which specified whether it is a datatype 
    49   or newtype and contains further information for each; 
    50  * !PrimTyCon, which are for built-in primitive tycons, and are also 
    51 used to represent base kinds;   
    52  * !CoercionTyCon, which are for special tycons which are meant to 
    53 represent syntactic forms (and not really type constructors), so they 
    54 must be saturated to have a kind; 
    55  * !SuperKindTyCon, which are tycons that are used to represent 
    56 super-kinds, also called sorts (which classify kinds as either 
    57 coercion kinds, CO, or type kinds, TY), !SuperKindTyCons are unique in 
    58 never having a kind.   
     47 * !AlgTyCon, which are for tycons for datatypes and newtypes and have a field of type !AlgTyConRhs which specified whether it is a datatype or newtype and contains further information for each; 
     48 * !PrimTyCon, which are for built-in primitive tycons, and are also used to represent base kinds;   
     49 * !CoercionTyCon, which are for special tycons which are meant to represent syntactic forms (and not really type constructors), so they must be saturated to have a kind; 
     50 * !SuperKindTyCon, which are tycons that are used to represent super-kinds, also called sorts (which classify kinds as either coercion kinds, CO, or type kinds, TY), !SuperKindTyCons are unique in never having a kind.   
    5951 
    6052All !TyCon's but !SuperKindTyCon and !CoercionKindTyCon carry their kind 
     
    6355coKindFun. 
    6456 
    65 = Kinds are Types = 
     57=== Kinds are Types === 
    6658 
    6759We have (as of August 2006) unified types and kinds as members of the 
     
    9486             /  \ 
    9587            *   # 
    96 }}} 
     88 
    9789where   *    [LiftedTypeKind]   means boxed type 
    9890        #    [UnliftedTypeKind] means unboxed type 
     
    10698        (->)  :: ?? -> ? -> * 
    10799        (\(x::t) -> ...)        Here t::?? (i.e. not unboxed tuple) 
    108  
    109 = Coercions and Coercion Kinds = 
     100}}} 
     101 
     102=== Coercions and Coercion Kinds === 
    110103 
    111104Coercions are type-level terms which act as evidence for type 
     
    157150coercion kind which need not be reflexive.   
    158151 
    159 = GADTs = 
     152=== GADTs === 
    160153 
    161154 representation 
     
    164157 
    165158 
    166 = Representation of coercion assumptions = 
     159=== Representation of coercion assumptions === 
    167160 
    168161In most of the compiler, as in the FC paper, coercions are abstracted 
     
    175168(where !PredTy (!EqPred T1 T2) is the kind of cv).  Also, several of the dataConXXX functions treat equality 
    176169 
    177 = Newtypes are coerced types = 
     170=== Newtypes are coerced types === 
    178171 
    179172The implementation of newtypes has changed to include explicit type coercions in the place of the previously used ad-hoc mechanism.  When a newtype