Re: Add non-escaping show functions
Hécate <[email protected]> Sun, 19 Dec 2021 19:33:07 +0100
| Newsgroups | gmane.comp.lang.haskell.libraries |
|---|---|
| Message-ID | <[email protected]> |
I would be very interested to integrate this in my text-display¹ library! ¹ https://github.com/haskell-text/text-display Le 19/12/2021 à 15:38, Kai Ma a écrit : > Hello Francesco, > >> Just to check if I understood correctly: only ghci will benefit from this >> proposal, right? Are there other place where printNE/showNE could be useful? > The motivation is to enhance the experience of ghci, but IMO there are a few other places it can be useful. Off the top of my head are: > > 1. Some development tools, like IHP’s tool, can use `showNE` in place of `show` to directly output Unicode strings. > 2. At least Text (and perhaps ByteString) can make use of `showNE`. > >> Why not a new typeclass instead of modifying the venerable `Show`? > > People are deriving Show for their types today, so adding methods to Show is a non-intrusive and backward-compatible way to update old code smoothly. > > Of course, an alternative way is to make GHC derive two instances simultaneously, for Show and for (say) ShowNE, but I’m not entirely sure whether it’s good practice. I agree adding a new class is better if deriving two instances is allowed. > > > Kai > _______________________________________________ > Libraries mailing list > [email protected] > http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries -- Hécate ✨ 🐦: @TechnoEmpress IRC: Hecate WWW: https://glitchbra.in RUN: BSD _______________________________________________ Libraries mailing list [email protected] http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries