[Haskell-cafe] ghc-api Static Semantics?

Christopher Brown cmb21 at st-andrews.ac.uk
Thu Jan 26 10:24:06 CET 2012


Hi Thomas,

By static semantics I mean use and bind locations for every name in the AST.

For example:


f x = let x = x + 1 in x

Should parse as something like

HsMatch ("f" (HsPat "x" (1,2) (1,2)) (HsBody (HsExp (HsLet (HsMatch ("x" (8,1) (8,1)) (HsExp (HsInfix (+) (1) ("x") (12,1) (8,1)) ("x" (16,1) (8,1))))

I'm steering towards haskell-src-exts right now as the sheer complexity of the ghc-api is putting me off. I need something simple, as I can't be spending all my time learning the ghc-api and hacking it together to do what I want. It does look a bit of a mess. Just trying to do simple things like parsing a file and showing its output proved to be much more complicated than it really needed to be.


> 
> Let me know if you decide to take on this project.
> 

We have decided to take it on. :)

Chris.




> 
> On 24 January 2012 10:35, Christopher Brown <cmb21 at st-andrews.ac.uk> wrote:
>>>> 
>>> 
>>> Have you looked at ghc-syb-utils, which gives a neat way to print an AST?
>>> 
>>> http://hackage.haskell.org/packages/archive/ghc-syb-utils/0.2.1.0/doc/html/GHC-SYB-Utils.html
>>> 
>> 
>> Yes I found that yesterday!
>> 
>> Chris.
>> 
>> 
>> 
>> 
>>> --
>>> JP Moresmau
>>> http://jpmoresmau.blogspot.com/
>>> 
>>> _______________________________________________
>>> Haskell-Cafe mailing list
>>> Haskell-Cafe at haskell.org
>>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>> 
>> 
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
> 
> 
> 
> -- 
> Push the envelope. Watch it bend.




More information about the Haskell-Cafe mailing list