Annotating Expressions

2003-12-16 Thread John Meacham
Imagine I have a data structure like so: data E = EAp E E | ELam Int E | ELetRec [(Int,E)] E | EVar Int now, I want to annotate every occurence of E with some pass specific information, such as free variables or levels for lambda lifting. in [PEY91] this technique was used: data EAn a = EaAp

Re: Annotating Expressions

2003-12-16 Thread Fergus Henderson
On 16-Dec-2003, John Meacham [EMAIL PROTECTED] wrote: newtype Id a = Id a type Er f = f (E f) -- E used recursivly data E f = EAp (Er f) (Er f) | ELam Int (Er f) | ELetRec [(Int,Er f)] (Er f) | EVar Int [...] problem 2 persists. If I don't want to be constantly casting to and

Re: Annotating Expressions

2003-12-16 Thread ajb
G'day all. Quoting John Meacham [EMAIL PROTECTED]: Imagine I have a data structure like so: data E = EAp E E | ELam Int E | ELetRec [(Int,E)] E | EVar Int now, I want to annotate every occurence of E with some pass specific information, such as free variables or levels for lambda lifting.

Re: Annotating Expressions

2003-12-16 Thread ajb
G'day all. Quoting Fergus Henderson [EMAIL PROTECTED]: Unless I missed something, none of those solve all the problems that Meacham is trying to solve (numbers 1 and 2 in his original mail). Many of them solve problem number 1, in that an unannotated structure is computationally identical to