Changes between Version 36 and Version 37 of DataParallel/ClosureConversion/ClassLess


Ignore:
Timestamp:
May 1, 2007 1:47:59 AM (7 years ago)
Author:
chak
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DataParallel/ClosureConversion/ClassLess

    v36 v37  
    8787 2. If '''all''' algebraic type constructors `S` that are mentioned in `T`'s definiton have `tyConCC S == ConvCC S`, we do not convert `T`, but set its `tyConCC` field to `ConvCC T` and generate a suitable conversion constructor `isoT`.  (NB: The condition implies that `T` does not mention any function arrows.) 
    8888 3. If the declaration of `T` uses any features that we cannot (or for the moment, don't want to) convert, we set its `tyConCC` field to `NoCC` - except if Case 2 applies. 
    89  4. Otherwise, we generate a converted type declaration `T_CC` together a conversion constructor  `isoT`, and set `tyConCC` to `ConvCC T_CC`.  Conversion proceeds by converting all data constructors (including their workers and wrappers), and in particular, we need to convert all types in the constructor signatures by replacing all type constructors that have conversions by their converted variant.  Data constructors get a new field `dcCC :: StatusCC DataCon`. 
     89 4. Otherwise, we generate a converted type declaration `T_CC` together a conversion constructor  `isoT`, and set `tyConCC` to `ConvCC T_CC`.  Conversion proceeds by converting all data constructors (see below). 
    9090Moreover, we handle other forms of type constructors as follows: 
    9191 * `FunTyCon`: It's `StatusCC` value was defined above.  We handle any occurence of the function type constructor like that of an algabraic type constructor with the `StatusCC` value given above, but we may not want to explcitly store that value in a field of `FunTyCon`, as `(:->)` would then probably need to go into `TyWiredIn` in. 
     
    9494 * `PrimTyCon`: We essentially ignore primitive types during conversion.  We assume their converted and unconverted form are identical, which implies that they never inhibit conversion and that they need no conversion constructors. 
    9595 * `CoercionTyCon` and `SuperKindTyCon`: They don't categorise values and are ignored during conversion. 
     96 
     97==== Converting data constructors ==== 
     98 
     99We also convert data constructors by converting their argument types.  In particular, the signature of the wrapper is converted.  However, in contrast to other functions, we only convert the argument and result types; the arrows tying them together are left intact.  For example, if the original wrapper has the type signature 
     100{{{ 
     101MkT :: (Int -> Int) -> Int 
     102}}} 
     103the converted wrapper is  
     104{{{ 
     105MkT_CC :: (Int :-> Int) -> Int 
     106}}} 
     107As a consequence, whenever we convert a ''partial'' wrapper application in an expression, we need to introduce a closure on the spot. 
     108 
     109We do not specially handle wrappers of data constructors.  They are converted just like any other toplevel function. 
     110 
     111==== Examples ==== 
    96112 
    97113For example, when we convert