Changes between Version 61 and Version 62 of TypeFunctionsStatus


Ignore:
Timestamp:
Aug 24, 2006 6:42:28 PM (8 years ago)
Author:
chak
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TypeFunctionsStatus

    v61 v62  
    44 
    55'''Current:'''  
    6  * Generate `CoExprFn` in case expressions scrutinising a data instance. 
    76 * In the exiting test for datacon validity, `checlValidDataCon`, we need to add a new test that checks for a data instance datacon that its tycon has the `FamilyTyCon` flag set and that it refers to the correct family tycon. 
    87 * Handle `newtype instance`. 
    98 
    109== Parsing and Renaming == 
     10 
     11Todo (low-level): 
     12 * Probably remove the `iso` flag. 
    1113 
    1214Todo (high-level): 
     
    2325 
    2426Todo (low-level): 
     27 * In an AT definition, no argument variable may be repeated. 
     28 * Check that the arguments of AT instances coincide with the respective instance arguments of their class. 
     29 * Check that each class instance has a definition for every AT and conversely that that all defined associated types are, in fact, part of the class. (Do this in the type checker - GHC does the corresponding checks for methods in the type checker, too.) 
     30 * Families declared as an AT, may not receive toplevel type instances. 
     31 * For each case scrutinising an associated data type, check that all constructors have been defined in a single instance.  (Maybe we can just extend the existing check that ensures that case expressions don't mix constructors of different data types.) 
    2532 * RHS of a `type instance` must be a tau type. 
    26  * In an AT definition, no argument variable may be repeated. 
    27  * Check that the arguments of AT instances coincide with the respective instance arguments of their class. This might be a bit more tricky if we want to allow that they can vary syntactically before expansion of type synonyms. 
    28  * Check that each class instance has a definition for every AT and conversely that that all defined associated types are, in fact, part of the class - with the exception of associated synonyms with a default definition. (Do this in the type checker - GHC does the corresponding checks for methods in the type checker, too.) 
    29  * Families declared as an AT, may not receive toplevel type instances. 
    3033 * Check that patterns of type indexes don't contain type functions. 
    31  * For each case scrutinising an associated data type, check that all constructors have been defined in a single instance.  (Maybe we can just extend the existing check that ensures that case expressions don't mix constructors of different data types.) 
    3234 * Construct `InstInfo` for type equation in `tcIdxTyInstDecl1`. 
    33   
     35 * If an associated synonym has a default definition, use that in the instances.  In contrast to methods, this cannot be overridden by a specialised definition.  (Confluence requires that any specialised version is extensionally the same as the default.) 
     36 
    3437Todo (high-level): 
    3538 1. Type checking of type functions (and hence, associated type synonyms); forget about `iso` for the moment. 
     
    4043 * Kind and type checking of kind signatures. 
    4144 * Kind and type checking of instance declarations of indexed types. 
     45 * Wrapper generation and type checking of pattern matching for indexed data types (no newtypes yet.) 
    4246 
    4347== Desugaring == 
    4448 
    4549Todo (low-level): 
     50 * Handle new type instances. 
    4651 * When a family type is exported/imported, all its instances need to be implicitly imported/exported, just as with classes. 
    4752 * Derivings on an associated data type ''declaration'' need to be inherited by all definitions of that data type in instances. 
    4853 
    4954Todo (high-level): 
    50  1. Desugar indexed data types. 
    51  2. Extend interface files. 
     55  1. Extend interface files to include euqality axioms: 
    5256   * How do we exactly want to represent type equations in interface files? 
    53     * SPJ pointed out that instances are maintained in `InstEnv.InstEnv` with different values for the home packages and others. The definitions of ATs may have to be maintained in a similar way, as they are also incrementally collected during compiling a program. 
    54     * `IfaceInst` contains the instance declaration information for interfaces. 
     57     * SPJ pointed out that instances are maintained in `InstEnv.InstEnv` with different values for the home packages and others. Type instances may have to be maintained in a similar way, as they are also incrementally collected during compiling a program.  (We probably include them in the same structure, as they will also be of type `InstInfo`.) 
     58     * `IfaceInst` contains the instance declaration information for interfaces. 
    5559   * Export and import lists: The name lists that may appear at class imports and exports can now also contain type names, which is tricky as data type names can carry a list of data constructors. 
    5660 3. Desugar type functions and equality constraints. 
     
    6266 * Extension of `DataCon.DataCon` with instance types for constructors belonging to data instances. 
    6367 * Extension of `TyCon.TyCon` such that the parent of a data instance is paired with a coercion identifying family instance and representation type. 
    64  * Datacon wrapper uses data instance coercion if applicable. 
     68 * For indexed data types, the datacon wrapper uses data instance coercion and pattern matching casts the scrutinee via an `ExprCoFn` in a `CoPat`. 
    6569 
    6670