
Sergey Mironov wrote:
Sorry for late answer. Luke, Heinrich - thank you very much for explanations. I feel that I need more reading to get familiar with differentiation of functors and chain rule. Could you suggest some books or papers?
For differentiation of data types, there is for example Conor McBride The Derivative of a Regular Type is its Type of One-Hole Contexts. http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.22.8611 but I'm not sure whether it's easier to understand than the wikibook. For more on using functors to model algebraic data types, see also R Backhouse, P Jansson, J Jeuring, L Meertens Generic Programming - An Introduction - http://www.cse.chalmers.se/~patrikj/poly/afp98/ A corresponding chapter in the wikibook ("Datatype algebra") has not been written, so far. Regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com