Changes between Version 36 and Version 37 of TypeFunctionsTypeChecking


Ignore:
Timestamp:
Sep 14, 2006 12:04:55 AM (8 years ago)
Author:
chak
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TypeFunctionsTypeChecking

    v36 v37  
    115115 
    116116The matching against the family type constructor and unification with the instance types corresponds to applying the coercion moving between the family and representation type of a data instance, which is returned by `tyConFamilyCoercion_maybe`.  To generate type correct core, this coercion needs to be applied to the scrutinee of the case expression matching on the constructor pattern.  This is done by the local function `unwrapFamInstScrutinee` whenever we match against the data constructor of a family by wrapping the result pattern into a `CoPat` containing an `ExprCoFn` with the coercion. 
     117 
     118== Checking for overlapping data/newtype instances == 
     119 
     120=== Overlap check of the instances within one module === 
     121 
     122We maintain a family instance environment in the `TcRnTypes.TcGblEnv` much like that for class instances.  We add instances to this environment as we type check them and perform an overlap check with each addition.