Data.Display - Textual representation of Haskell values (was Re: PROPOSAL: Add displayException to Exception typeclass)

Greg Weber greg at gregweber.info
Tue Nov 11 14:25:22 UTC 2014


On Mon, Nov 10, 2014 at 11:31 PM, Simon Hengel <sol at typeful.net> wrote:

> On Mon, Nov 10, 2014 at 10:25:45AM -0800, Greg Weber wrote:
> > What is the goal of this project? To pretty-print output? Or to be a
> > slightly friendlier version of Show?
>
> From my perspective display would be akin to str()/#to_s in Python/Ruby.
> So I was not thinking to tackle pretty-printing in general.
>
> My *very personal* main use case, that I don't see other good solutions
> for, is string interpolation.  Currently I have a crude hack in
> interpolate [1] that does the right thing for String, Text and many
> prelude types (see also [2] if you are curious).


> But even more important to me is that we come up with something that is
> general, has minimal dependencies and is not controversial, so that
> people are willing to depend on it and provide instances.
>

Your interpolate package looks the same as shakespeare-text, and Display
seems similar to ToText.

http://hackage.haskell.org/package/shakespeare-2.0.1.1/docs/Text-Shakespeare-Text.html

It would make sense to have a single Display typeclass.


>
>
> [1]
> https://github.com/sol/interpolate/blob/9be1f6d15722c58e467e7ebc0cb6dc6fb2c4f5e0/src/Data/String/Interpolate/Internal/Util.hs#L9
> [2] http://sol.github.io/interpolate-talk/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20141111/04926212/attachment.html>


More information about the Libraries mailing list