Pretty class as alternative for Show class

Johan Tibell johan.tibell at gmail.com
Wed Feb 13 02:43:07 EST 2008


On Feb 13, 2008 7:45 AM, Henning Thielemann
<lemming at henning-thielemann.de> wrote:
>
>  There seems to be the need for (at least) two classes for showing values
> in Haskell: One class that outputs values in a way that can be copied and
> pasted into Haskell programs. This is useful in GHCi. Another class (say
> Pretty) that shows values in a prettily formatted way. Current libraries
> use the Show class for both applications depending on the taste of the
> author. A third class would be useful for outputting values with markup,
> say HTML or LaTeX.

I've started to do this for my own code now. I use Show as an
equivalent of Python's 'repr' and pretty for displaying things to
users.

-- Johan


More information about the Libraries mailing list