Changes between Version 36 and Version 37 of DataParallel/ClosureConversion/ClassLess
- Timestamp:
- 04/30/07 18:47:59 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DataParallel/ClosureConversion/ClassLess
v36 v37 87 87 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.) 88 88 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). 90 90 Moreover, we handle other forms of type constructors as follows: 91 91 * `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. … … 94 94 * `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. 95 95 * `CoercionTyCon` and `SuperKindTyCon`: They don't categorise values and are ignored during conversion. 96 97 ==== Converting data constructors ==== 98 99 We 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 {{{ 101 MkT :: (Int -> Int) -> Int 102 }}} 103 the converted wrapper is 104 {{{ 105 MkT_CC :: (Int :-> Int) -> Int 106 }}} 107 As a consequence, whenever we convert a ''partial'' wrapper application in an expression, we need to introduce a closure on the spot. 108 109 We do not specially handle wrappers of data constructors. They are converted just like any other toplevel function. 110 111 ==== Examples ==== 96 112 97 113 For example, when we convert
