Changes between Version 20 and Version 21 of DataParallel/ClosureConversion/ClassLess


Ignore:
Timestamp:
Apr 27, 2007 4:34:51 AM (7 years ago)
Author:
chak
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DataParallel/ClosureConversion/ClassLess

    v20 v21  
    3434  (TF (C _1 .. _n) (C_CC _1_CC .. _n_CC)) 
    3535}}} 
    36 (The type variables beginning with underscores are bound here and we add one underscore for each level of kinding.) 
     36(The type variables beginning with underscores are bound here; we add one underscore for each level of kinding.) 
     37 
     38As an example, consider 
     39{{{ 
     40data T (f::*->*) = T1 (f Int) | T2 (f Bool) 
     41}}} 
     42The type of the conversion constructor is as follows (using more meaningful type variable names): 
     43{{{ 
     44tfTy (T::(*->*)->*) = 
     45  forall f f_CC.  
     46    (forall a a_CC.  
     47       (TF a a_CC) -> (TF (f a) (f_CC a_CC))) -> 
     48    TF (T f) (T_CC f_CC) 
     49}}} 
     50The conversion constructor might be implemented as 
     51{{{ 
     52tfT tff = TF toT frT 
     53  where 
     54    toT (T1 x) = T1 (to (tff tfInt ) x) 
     55    toT (T2 y) = T2 (to (tff tfBool) y) 
     56    frT (T1 x) = T1 (fr (tff tfInt ) x) 
     57    frT (T2 y) = T2 (fr (tff tfBool) y) 
     58}}} 
     59where `tfInt` and `tfBool` are the conversion constructors for `Int`s and `Bool`s. 
    3760 
    3861Moreover, we have a type constructor `(-->)` that represents closures and we assume that the field `tyConCC` of `(->)` has the value `ConvCC ((-->), fr_fun, to_fun)`, where `fr_fun` and `to_fun` are appropriate conversion functions.