Changes between Version 54 and Version 55 of TypeFunctionsTypeChecking


Ignore:
Timestamp:
Jun 29, 2007 4:41:47 AM (8 years ago)
Author:
chak
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TypeFunctionsTypeChecking

    v54 v55  
    1111Type checking in the presence of only data and newtype families is much simpler than in the presence of type synonym families as type equality remains purely syntactic (i.e., we do not need to change the unification procedure).  However, we need to check that the alternatives of a case expression inspecting an indexed data/newtype family contains only constructors of one member of the family.  (To relax this restriction, we would need a story for compiling open data types.) 
    1212 
    13 However, this difference in complexity applies only to the type checking of expression whose types involve data and type synonym families, respectively.  Type checking of the declarations themselves is not that different; in fact, data/newtype family declarations require more effort as they introduce data type constructors, which need to be handled as well.  However, a lot of machinery can be re-used from vanilla algebraic data types. 
     13However, this difference in complexity applies only to the type checking of expression whose types involve data and type synonym families, respectively.  Type checking of the declarations themselves is not that different; in fact, data family declarations require more effort as they introduce data type constructors, which need to be handled as well.  However, a lot of machinery can be re-used from vanilla algebraic data types. 
    1414 
    1515=== Type checking family declarations and family instances === 
     
    2828 `type family`:: 
    2929   Type synonym families are represented by the standard `TyCon` variant for synonyms, namely `SynTyCon`.  They are distinguished from ordinary type synonyms by the value of the field `synTcRhs`, which is now of a new data type `SynTyConRhs`, which has a variant `OpenSynTyCon resKind` to represent families. 
    30  `data family` and `newtype family`:: 
    31    Data and newtype families are represented by the `TyCon` variant `AlgTyCon`, as are their non-indexed counter parts, with the difference that the field `algTcRhs` has the one of the newly introduced values `OpenDataTyCon` or `OpenNewTyCon`. 
     30 `data family``:: 
     31   Data families are represented by the `TyCon` variant `AlgTyCon`, as are their non-indexed counter parts, with the difference that the field `algTcRhs` has the one of the newly introduced values `OpenDataTyCon` or `OpenNewTyCon`. 
    3232 
    3333=== Synonym type constructors: `SynTyCon` ===