Why are there no Show instances for internal types

Simon Peyton Jones simonpj at microsoft.com
Mon Mar 20 12:51:13 UTC 2017


| > >- 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.
| 
| Show and Outputable have very different goals though.

Really? What's wrong with using Outputable, plus, as Joachim says, 

	showSDocUnsafe . ppr :: Outputable a => a -> String

Maybe you want to really really see the precise data constructors used.  But for the most part the Outputable instance tells you that, but much more legibly.

Simon


More information about the ghc-devs mailing list