Changes between Version 72 and Version 73 of DataParallel/ClosureConversion/ClassLess


Ignore:
Timestamp:
May 18, 2007 7:34:07 AM (8 years ago)
Author:
chak
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DataParallel/ClosureConversion/ClassLess

    v72 v73  
    357357$WC_CC = /\a1..an -> lam_m (C_CC@a1@..@an)
    358358}}}
     359where the family of functions
     360{{{
     361lam_1 :: (a1 -> b) -> (a1 :-> b)
     362lam_1 = lam
     363
     364lam_n :: (a1  -> ..  -> an  -> b)
     365      -> (a1 :-> .. :-> an :-> b)
     366lam_n f =
     367  lam_(n-1) $
     368    \x1 .. x(n-1) -> uncurry_(n-1) f :$ (x1, .., x(n-1)
     369}}}
     370turns an `n`-ary function into an `n`-ary closure.  (NB: This is not the same as `(to iso<..>)` for that type, as we do not convert the types of the arguments of the function.)
    359371
    360372We translate terms as follows:
    361373{{{
    362 cc[[C]]                  = $WC_CC
     374cc[[C]]
     375  | if C_CC exists       = $WC_CC
    363376cc[[x::t]]
    364377  | if x_CC exists       = x_CC
     
    366379cc[[lit]]                = lit
    367380cc[[e1 e2]]              = cc[[e1]] $: cc[e2]
    368 cc[[e1@t]]               = cc[[e1]]@t^
     381cc[[e@t]]                = cc[[e]]@t^
    369382cc[[\x -> e]]            = (\(y1, .., yn) x_CC -> cc[e]]) :$
    370383                           (y1, .., yn)
     
    383396  | otherwise           = C x1 .. xn -> cc[[e]]
    384397}}}
    385 where the family of functions
    386 {{{
    387 lam_n :: (a1  -> ..  -> an  -> b)
    388       -> (a1 :-> .. :-> an :-> b)
    389 }}}
    390 turns an `n`-ary function into an `n`-ary closure.  (NB: This is not the same as `to iso` for that type, as we do not convert the types of the arguments of the function.)
     398
    391399
    392400