Add non-escaping show functions

Hécate hecate at glitchbra.in
Sun Dec 19 18:33:07 UTC 2021


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
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

-- 
Hécate ✨
🐦: @TechnoEmpress
IRC: Hecate
WWW: https://glitchbra.in
RUN: BSD



More information about the Libraries mailing list