
Hi, I am trying to modify LiquidHaskell and want to see how source code is represented in AST format. I think I have AST i.e. HsExpr value, but there is no Show instance for that. I noticed that GHC classes implement similar class Outputable, but it doesn't do what I expected. It just reconstruct AST back to source code. I could probably write a TH function generating Show instances for all types which HsExpr depends on, but I hope there is more straight forward way to do that. And after all I curious what is the reason for not having Show for GHC AST types? It would be so convenient having Show. -- Daneel S. Yaitskov Java Developer

You can use the `showAstData` function in order to view the AST. There
are also flags `-ddump-parsed-ast`, `-ddump-rn-ast` and
`-ddump-tc-ast` which can be used on the command line.
Cheers,
Matt
On Wed, Apr 22, 2020 at 6:03 AM Daneel Yaitskov
Hi,
I am trying to modify LiquidHaskell and want to see how source code is represented in AST format. I think I have AST i.e. HsExpr value, but there is no Show instance for that. I noticed that GHC classes implement similar class Outputable, but it doesn't do what I expected. It just reconstruct AST back to source code.
I could probably write a TH function generating Show instances for all types which HsExpr depends on, but I hope there is more straight forward way to do that.
And after all I curious what is the reason for not having Show for GHC AST types? It would be so convenient having Show.
--
Daneel S. Yaitskov Java Developer _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
participants (2)
-
Daneel Yaitskov
-
Matthew Pickering