Re: [Haskell-cafe] Adding type annotations to an AST?

2012-03-14 Thread Sean Leather
Hi Stephen, On Mon, Mar 5, 2012 at 08:52, Stephen Tetley wrote: How do I add type annotations to interior locations in an abstract syntax tree? I use an annotated expression tree in my work. The nodes of the AST are annotated with the type, assumption set, and constraint set as described in

Re: [Haskell-cafe] Adding type annotations to an AST?

2012-03-14 Thread Stephen Tetley
Hi Sean Many thanks - the note on flow-issues might be particularly helpful for me (last para section 4 introduction). My current code has a bug which maybe this identifies. I'm currently using a modified algorithm M which I believe is top down, I'll switch to algorithm W. Thanks again Stephen

Re: [Haskell-cafe] Adding type annotations to an AST?

2012-03-06 Thread Stephen Tetley
Hi Oleg - many thanks On 6 March 2012 07:15, o...@okmij.org wrote: How do I add type annotations to interior locations in an abstract syntax tree? {Snip}        Here is the solution http://okmij.org/ftp/Computation/FLOLAC/TEvalNR.hs        There is a bit of the explanation here:

Re: [Haskell-cafe] Adding type annotations to an AST?

2012-03-05 Thread Stephen Tetley
Partially answering my own question - it seems like I want type directed translation as per section 8 of Practical Type Inference for Arbitrary Ranked Types. Does anyone know of a presentation with a simpler type language? Thanks again Stephen ___

Re: [Haskell-cafe] Adding type annotations to an AST?

2012-03-05 Thread oleg
How do I add type annotations to interior locations in an abstract syntax tree? i.e. the type it [algorithm] infers is the type of the whole program, I would also like the types of any internal let-rec definitions so I can label my AST. I had exactly the same problem: type

[Haskell-cafe] Adding type annotations to an AST?

2012-03-04 Thread Stephen Tetley
Hello All How do I add type annotations to interior locations in an abstract syntax tree? I have a small ML language where programs are a single expression, but the expression type has let-rec so it supports recursive function definitions. Source programs have no type annotations. I want to