Changes between Version 7 and Version 8 of DataParallel/ClosureConversion
- Timestamp:
- 04/20/07 04:47:38 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DataParallel/ClosureConversion
v7 v8 38 38 ==== Mixing converted and vanilla code ==== 39 39 40 Mixing converted and vanilla code for closure-conversion is simple as long as we only have lambda terms (we just generate and apply closure as appropriate at places where we move from one representation to another). However, data types make this more involved again. Imagine the following scenario: 41 {{{ 42 -- converted code 43 data T = MkT (Int -> Int) 44 45 -- unconverted code 46 foo = MkT ((+) (1::Int)) 47 48 -- converted code 49 appT :: T -> Int -> Int 50 appT (MkT f) x = f x 51 52 bar = appT foo 53 }}} 54 Here the result of `foo` needs to be converted before we can call `appT` in `bar`. In other words, we need conversion functions between converted and unconverted versions of data types. 55 40 56 ==== An alternative: one-the-fly closure conversion ==== 41 57
