[Haskell-cafe] code generation

z ghost zghost123 at yahoo.com
Tue Oct 21 13:09:37 EDT 2008

Thanks for that! I don't know yet what would be the easiest way
to automatically build up haskell code (Template haskell's Exps or 
the HsDecls in your link).

Generating is only a part of what i need, though. I would like some
feedback from GHC about the generated code (to see if the expressions typecheck, ..)

I've been using the Hint package (which calls GHC) to typecheck 
strings http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hint
I've only managed to get it half working. Have you tried this and 
would this be the best approach?

It would  be great to get machine-readable error data back from GHC somehow (in stead of an error string). I don't if this is possible.

--- On Tue, 10/21/08, Antoine Latter <aslatter at gmail.com> wrote:
From: Antoine Latter <aslatter at gmail.com>
Subject: Re: [Haskell-cafe] code generation
To: zghost123 at yahoo.com
Cc: haskell-cafe at haskell.org
Date: Tuesday, October 21, 2008, 3:50 PM

2008/10/20 z ghost <zghost123 at yahoo.com>:
> hello, im interested in using haskell to generate code and make
> little AI applications for fun..
> is anyone already doing this sort of thing? it would be fun to collaborate
> with people on this.

I've been doing some work with Haskell code-generation in Haskell, but
I've been using the haskell-src package to do it instead of Template
Haskell, as I've been generating whole modules at a time.

I have a bunch of convenience functions that I use over here:


It doesn't have a very consistent API, though.  Let me know if you
have any questions about it.


Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the Haskell-Cafe mailing list