Changes between Version 1 and Version 2 of TypeFunctionsStatus


Ignore:
Timestamp:
Jul 27, 2006 8:42:26 PM (8 years ago)
Author:
chak
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TypeFunctionsStatus

    v1 v2  
    33== Parsing and Renaming == 
    44 
    5 Todo: 
     5Todo (high-level): 
    66 1. Complete parsing of associated type synonyms.  (Syntactically type declarations can already occur in classes, but I am not sure whether the AST building routines can already deal with this.) & parse type functions. 
    77 2. Rename associated type synonyms & rename type functions. 
     
    1111 * Parsing and renaming associated data types. 
    1212 
     13 
    1314== Type Checking == 
    1415 
    15 Todo: 
     16Todo (low-level): 
     17 * We need to require -fglasgow-exts for ATs. (The type checker seems to be the place to check whether the flag was supplied.) To check this for classes, we need to have `Class.Class` suitably extended; the infrastructure for the check is already builtin in (see `binding no_ats` in `checkValidClass`). 
     18 * Check that each AT definition mirrors the class arguments of the instance in its type indexes. This might be a bit more tricky if we want to allow that they can vary syntactically before expansion of type synonyms. (Do this in the type checker unless we find it is very hard to do there; then, revert to trying it during renaming.) 
     19 * Check that each instance has a definition for every AT and also that all defined associated types are, in fact, declared by the class. (Do this in the type checker - GHC does the corresponding checks for methods in the type checker, too.) Also check that kind signatures that correspond to type variables in the AT declaration or class declaration match the kinds inferred for the AT declaration. (This certainly needs to be done in the type checker.) 
     20 * We need to somehow change the signatures of data constructors of ATs around so that they mention the Name of the type constructor declared in the class (and not the one of the instance the data constructor was declared in). Might be able to do that via a GADT style signature.  '''Rethink this under the new scheme.''' 
     21 
     22Todo (high-level): 
    1623 1. Type checking of associated data types. 
    1724 2. Type checking of type functions (and hence, associated type synonyms). 
     
    2128 * Kind checking for associated data types. 
    2229 
     30 
    2331== Desugaring == 
    2432 
    25 Todo 
     33Todo (low-level): 
     34 * Derivings on an associated data type ''declaration'' need to be inherited by all definitions of that data type in instances. 
     35 
     36Todo (high-level): 
    2637 1. Desugar associated data types. 
    2738 2. Desugar type functions and equality constraints. 
    2839 3. Extend interface files. 
     40  * How do we exactly want to represent ATs in interface files? 
     41   * 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. 
     42   * `IfaceInst` contains the instance declaration information for interfaces. 
     43  * 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. 
     44  * At the moment, we add as the parent name of the data constructors of associated data types defined in instances, the new name for the data type constructor, which is ''different'' from that of the data type constructor in the class (also their source representation is the same). We may need to fix that during renaming. (We can't easily fix it in `getLocalDeclBinders`, where the names of the data constructors are made, as we don't have the means to get at the right class at that point.) 
    2945 
    3046Done: Nothing. 
     47 
     48 
     49== Testsuite == 
     50 
     51Todo: 
     52 * Convert AT.hs to tests in the testsuite.