Alexander Bernauer bernauer at
Thu May 12 09:33:07 BST 2011

Hi Warren,

On Wed, May 11, 2011 at 04:34:36PM -0700, Warren Harris wrote:
> That sounds like what I was looking for. I noticed that 'show' will either
> print things as C syntax (e.g. a CInteger will print out as "123" rather
> than "CInteger 123"), or using a syntax for readability (e.g. identifiers
> print as `foo' rather than as "Ident \"foo\" ..."). But maybe DumpAst.hs
> will do the right thing.

DumpAst ist just a simple tool to figure out match patterns. It
completely relies on the language-c library and provides no magic on its
own - maybe except for restraining the dump of NodeInfo values.

As Benedikt mentioned, in the current development version, the Show
instances of the AST types return valid Haskell syntax. But as you
noticed, there are some abbreviations.

As far as I understood your concern you really need to have the Haskell
representation of the Language-C AST that represents the quasi-quoted
code, right?

In that case we should go on and change the remaining Show instances. As
far as I can see this involves Ident and all constants. Anything else?

I think, this would be a simple patch. Shall we? 

Or is there a good use for the abbreviated Show instances, too? IMO in
these cases the AST could always be pretty printed, couldn't it?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <>

More information about the Language-c mailing list