Why are there no Show instances for internal types

Ben Gamari ben at smart-cactus.org
Sat Mar 18 20:13:52 UTC 2017



On March 18, 2017 9:03:48 AM EDT, Tom Sydney Kerckhove <syd.kerckhove at gmail.com> wrote:

Snip.
>
>My questions for you:
>
>- Is there a reason that there are no derived 'Show' instances for most
>  types?

As Richard mentioned, we don't derive Show due to code size and compilation time concerns. Show in particular is rather expensive to derive and seeing as we already have Outputable I don't it would make sense to derive it by default. I would really like to avoid introducing more CPP into the code base for this particular problem.

One alternative which will work in many cases is to simply derive Show yourself using StandaloneDeriving. Does this help?

Cheers,

- Ben 

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.


More information about the ghc-devs mailing list