[Haskell-cafe] Can we improve Show instance for non-ascii charcters?

David Turner dct25-561bs at mythic-beasts.com
Thu Feb 4 07:57:17 UTC 2016


One of the most visible uses of Show is that it's how values are shown in
GHCi. As mentioned earlier in this thread, if you're teaching in a
non-ASCII language then the user experience is pretty poor.

On the other hand, I see Show (like .ToString() in C# etc.) as a debugging
tool: not for seriously robust serialisation but useful if you need to dump
a value into a log message or email or similar. And in that situation it's
very useful if it sticks to ASCII: non-ASCII content just isn't resilient
enough to being passed around the network, truncated and generally
mutilated on the way through.

These are definitely two different concerns and they pull in opposite
directions in this discussion. It's a matter of opinion which you think is
more important. Me, I think the latter, but then I do a lot of logging and
speak a language that fits into  ASCII. YMMV!
On 4 Feb 2016 07:38, "Imants Cekusins" <imantc at gmail.com> wrote:

> is the purpose of the show :
>
> a) serialization to string?
> or
> b) text representation?
>
> if a) then why is unexpected display - a concern?
> if b) then why is inconsistency - a concern?
>
> if more than one way to display c is possible, then should we expect
> both a) and b) from Show?
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20160204/0637acff/attachment.html>


More information about the Haskell-Cafe mailing list