Wed Jan 13 08:37:20 CET 2010
I'm trying to understand this magnificent paper by Conal Elliott.
Click trough for a video presentation from ICFP 2009.
The basic idea is that by using an abstract, recursive definition of
the chain rule and some clever function overloading, it is possible to
implement AD using very general high level code.
The code that can be found here doesn't seem to have the most
general version of the chain rule (multiplication replaced by
composition with linear map). Or do I miss something?
-- The chain rule
infix 0 >-<
(>-<) :: (Num a) => (a -> a) -> (Dif a -> Dif a) -> Dif a -> Dif a
f >-< d = \ p@(D u u') -> D (f u) (d p * u')