Mon Feb 15 11:38:27 CET 2010

Combining Cas.hs and Ai.hs

I'm writing transformations from Term a <-> CT a (Term a) such that
ctOp can be used to perform algebraic simplification for + and *.

As a side note: the Haskell type system is incredibly useful for
writing transformations like these.  I think I'm hooked!  I.e. this is
just beautiful:

ctLift :: Num a => CTtx a -> Binop a -> TBinop a
ctLift (ct, ict) binop = f where 
    (<*>) = ctOp binop                -- lift Binop to CTBinop
    f a b = ict ((ct a) <*> (ct b))   -- pullback to yield TBinop