[Haskell-cafe] Where is Show for GHC AST?

Daneel Yaitskov dyaitskov at gmail.com
Wed Apr 22 05:02:01 UTC 2020


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

More information about the Haskell-Cafe mailing list