On Thu, Apr 26, 2012 at 10:21:36AM +0200, José Pedro Magalhães wrote:
Hi Romildo,
If I understand correctly, you now want to add annotations to mutually-recursive datatypes. The annotations package supports that. Section 8 of our paper [1] gives an example of how to do that, and also Chapter 6 of Martijn's MSc thesis [2].
Let me know if these references do not answer your question.
I am reading Martijn's MSc thesis and trying some code he presents. In secton 5.1 he presents catamorphisms over fixed points. The code I am trying is attached. When evaluating the expression cata exprEval (runExpr (1+2*3)) I am getting the following error: No instance for (Functor ExprF) arising from a use of `cata' Possible fix: add an instance declaration for (Functor ExprF) In the expression: cata exprEval (runExpr (1 + 2 * 3)) In an equation for `it': it = cata exprEval (runExpr (1 + 2 * 3)) How should an instance of (Functor ExprF) be defined? It is not shown in the thesis. Romildo