Why are there no Show instances for internal types
Joachim Breitner
mail at joachim-breitner.de
Mon Mar 20 14:45:43 UTC 2017
Hi,
Am Montag, den 20.03.2017, 12:51 +0000 schrieb Simon Peyton Jones via ghc-devs:
> 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.
and if using Outputable is a bit annoying sometimes (e.g. I found it
hard to get the IdInfo of an Id that is not part of a binder, if I
recall correctly, because the default instance does not include that
info, and the pretty printer for “id with idinfo” is not exported),
well, we can always improve that by adding a few more helpful functions
to Outputable.
Greetings,
Joachim
--
Joachim “nomeata” Breitner
mail at joachim-breitner.de • https://www.joachim-breitner.de/
XMPP: nomeata at joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F
Debian Developer: nomeata at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20170320/09bccc2d/attachment.sig>
More information about the ghc-devs
mailing list