Changes between Version 30 and Version 31 of DataParallel/ClosureConversion/ClassLess


Ignore:
Timestamp:
Apr 30, 2007 10:49:46 AM (8 years ago)
Author:
chak
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DataParallel/ClosureConversion/ClassLess

    v30 v31  
    128128We 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.
    129129
     130As an example, assume `Num Int` were defined as
     131{{{
     132class Num a where
     133  (+)    :: a -> a -> a
     134  negate :: a -> a
     135instance Num Int where
     136  (+)    = primAddInt
     137  negate = primNegateInt
     138}}}
     139with the Core code being
     140{{{
     141data Num a =
     142  Num {
     143    (+)    :: a -> a -> a,
     144    negate :: a -> a
     145  }
     146dNumInt = Num Int
     147dNumInt = Num primAddInt primNegateInt
     148}}}
     149Then, closure conversion gives us
     150{{{
     151data Num_CC a =
     152  Num_CC {
     153    (+_CC)    :: a :-> a :-> a,
     154    negate_CC :: a :-> a
     155  }
     156dNumInt_CC :: Num_CC Int  -- Int \equiv Int_CC
     157dNumInt_CC = Num_CC $: fr?? isoInt primAddInt $: fr?? isoInt primNegateInt
     158!!!TODO
     159}}}
     160
     161
    130162----
    131163chak: revision front