I use GHCi a lot, and want to look at the TH splices, and see how the results of my own TH, however, the default Show instance doesn’t do any indentaition. I know it is definitely possible to write the printer that would do what I want, with Data.Data, however is there already one defined?
E.G.
[d|instance Show (a -> b) where show _ = "Fun" |]
should give
[InstanceD
Nothing
[]
(AppT
(ConT GHC.Internal.Show.Show)
(AppT
(AppT
ArrowT
(VarT a_0))
(VarT b_1)))
[FunD
GHC.Internal.Show.show
[Clause
[WildP]
(NormalB
(LitE (StringL "Fun")))
[]]]]
I just want to get a printer like this, doesn’t need to be identitical.