
Hello. I am reading Martijn's MSc Thesis "Generic Selections of Subexpressions", where one can found some discussions about annotating abstract syntax trees (AST). In order to follow the discussion I wrote the attached Haskell program, which is an interpreter for an simple typed expression language. The Annotations package is used. The expression pattern is represented by a single recursive data type. Annotations are used for positions in the input source, and also for the type of expressions and subexpressions. I would like somebody to review the code and comment on it, as I am not sure I am using the concepts right. Also I would like the type checker to produce an expression annotated with both positions and calculated types. Currently it discards the position annotations. Any sugestions on how to modify it is welcome. Next step is adding a new form of expression to introduce local variable bindings. After that I want to start working with ASTs represented by mutually recursive data types. Then I will need multirec... Romildo