Show-like output of GHC data types

Johan Tibell johan.tibell at
Fri Mar 8 17:53:22 CET 2013

On Fri, Mar 8, 2013 at 8:26 AM, Nicolas Frisby <nicolas.frisby at>wrote:

> On Fri, Mar 8, 2013 at 9:39 AM, Simon Peyton-Jones <simonpj at>wrote:
>>  What I would like to see is something like:****
>> HsApp (HsApp (HsApp (HsVar "foldl'") (HsVar "+")) (HsLit 0)) (HsVar "xs")
>> ****
>> We could derive ‘Show’ on everything but that would generate a LOT of new
>> code, that would seldom be used.  Also ‘Show’ doesn’t pretty-print so the
>> result would be illegible. ****
>> **
> If plugins could be used before the conversion to Core, such a plugin
> might be a tidy way to workaround the issue of bloating GHC's binary size
> with all that Show code.
> This previous email thread
> seems
> relevant, and Marlow's comment there makes it sound like a pretty easy
> change.

I'm currently writing a ShowInstances module with orphan Show instances for
all GHC data types. I will just import that during development, but not
include it in the final code. It will hopefully satisfy my current need.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ghc-devs mailing list