Changes between Version 40 and Version 41 of TypeFunctionsTypeChecking


Ignore:
Timestamp:
Dec 18, 2006 10:50:47 PM (8 years ago)
Author:
chak
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TypeFunctionsTypeChecking

    v40 v41  
    1818 
    1919Instances of indexed types are type checked by `TcTyClDecls.tcIdxTyInstDecl`; i.e., the same functions that performs their kind checking.  Kind checking and type checking of instances of indexed types can be combined, as we don't need to worry as much about recursive dependencies as we have to for standard type declarations.  In particular, the kinds of indexed types are declared by their signature and we don't have to compute any recursiveness information, as we never know whether we reached a fixed point for open types.  (Hence, we conservatively assume indexed types to be always `Recursive`.  This is safe as they are implicit loop breakers due to to implying coercions.) 
     20 
     21=== Deriving clauses at data instances === 
     22 
     23The main issue when handling `deriving` clauses for data instances in `TcDeriv` is using the representation tycon, where needed (instead of the family tycon, which appears in the actual declaration).  In particular, the list of constructors is only available from the representation tycon.  These constructors already have appropriate signatures mentioning the family tycon in the result type, so that most of the deriving machinery works out of the box.  As `TcDeriv.makeDerivEqns` extracts the set of class instances that need to be derived from the un-typechecked source form, we need the new `TcEnv.tcLookupFamInst` to look up type-checked family instances from tycon/type-indexes pairs.  (All information needed for that is already available in the type checker environment.) 
    2024 
    2125== Core representation of signatures of indexed families ==