Changes between Version 57 and Version 58 of DataParallel/ClosureConversion/ClassLess


Ignore:
Timestamp:
May 1, 2007 8:56:30 AM (7 years ago)
Author:
chak
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DataParallel/ClosureConversion/ClassLess

    v57 v58  
    184184MkT_CC :: (Int :-> Int) -> Int 
    185185}}} 
    186 As a consequence, whenever we convert a ''partial'' wrapper application in an expression, we need to introduce a closure on the spot.  (Simon pointed out that this is a rare case anyway.) 
    187  
    188 We do not specially handle wrappers of data constructors.  They are converted just like any other toplevel function. 
     186As a consequence, whenever we convert a ''partial'' worker application in an expression, we need to introduce a closure on the spot.  (Simon pointed out that this is a rare case anyway.) 
     187 
     188We do not specially handle wrappers of data constructors or field selectors.  They are converted just like any other toplevel function. 
    189189 
    190190==== Examples ==== 
     
    244244Then, closure conversion gives us 
    245245{{{ 
    246 data Num_CC a = 
    247   Num_CC { 
    248     (+_CC)    :: a :-> a :-> a, 
    249     negate_CC :: a :-> a 
    250   } 
     246data Num_CC a = Num_CC (a :-> a :-> a) (a :-> a) 
     247(+_CC)    :: Num_CC a :-> a :-> a :-> a 
     248negate_CC :: Num_CC a :-> a :-> a 
     249 
    251250dNumInt_CC :: Num_CC Int   -- as Int_CC = Int 
    252251dNumInt_CC = Num_CC  
     
    296295add_CC :: Num_CC a :-> a :-> a 
    297296add_CC = lam $ \dNum ->  
    298            (\dNum x -> (+_CC) dNum $: x $: 1) :$ dNum 
    299 }}} 
    300 Note how we have to be careful not to use `($:)` for field selection from the dictionary. 
     297           (\dNum x -> (+_CC) $: dNum $: x $: 1) :$ dNum 
     298}}} 
     299 
    301300 
    302301=== Converting terms ===