Wed Dec 7 00:55:14 EST 2011
Just structuring of representation (<-> representation of structuring)
I separated operations on structuring of representation (ras) and
those that work both on ras and representation of structuring (r as).
The latter are only used in Loop (packing/unpacking in _app and
_lambda), and it seems that Sys only need to know StructComp.
class StructComp stx ras | ras -> stx where
-- Support for compilation: nb of atomic elements, typed variable
-- creation, and compilation to flat syntax type. To select the
-- right type, pass (undefined :: <type>) for the first arg.
structSize :: ras -> Int
structVariables :: ras -> [VarName] -> (ras, [VarName])
structCompile :: ras -> [stx]
class StructComp stx ras =>
Struct stx r as ras | ras -> r as, r as -> ras, r -> stx where
-- Commute representation and data structuring,
-- i.e. (r a, (r b, r c)) <-> r (a,(b,c))
structPack :: ras -> r as
structUnpack :: r as -> ras