Changes between Version 30 and Version 31 of DataParallel/ClosureConversion/ClassLess
- Timestamp:
- 04/30/07 03:49:46 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DataParallel/ClosureConversion/ClassLess
v30 v31 128 128 We don't alter class and instance declarations in any way. However, the dictionary type constructors and dfuns are processed in the same way as other data types and value bindings, respectively; i.e., they get a `StatusCC` field and we generate converted versions and conversion constructors as usual. 129 129 130 As an example, assume `Num Int` were defined as 131 {{{ 132 class Num a where 133 (+) :: a -> a -> a 134 negate :: a -> a 135 instance Num Int where 136 (+) = primAddInt 137 negate = primNegateInt 138 }}} 139 with the Core code being 140 {{{ 141 data Num a = 142 Num { 143 (+) :: a -> a -> a, 144 negate :: a -> a 145 } 146 dNumInt = Num Int 147 dNumInt = Num primAddInt primNegateInt 148 }}} 149 Then, closure conversion gives us 150 {{{ 151 data Num_CC a = 152 Num_CC { 153 (+_CC) :: a :-> a :-> a, 154 negate_CC :: a :-> a 155 } 156 dNumInt_CC :: Num_CC Int -- Int \equiv Int_CC 157 dNumInt_CC = Num_CC $: fr?? isoInt primAddInt $: fr?? isoInt primNegateInt 158 !!!TODO 159 }}} 160 161 130 162 ---- 131 163 chak: revision front
