Data.Display - Textual representation of Haskell values (was Re: PROPOSAL: Add displayException to Exception typeclass)
Simon Hengel
sol at typeful.net
Tue Nov 11 07:36:07 UTC 2014
> Relatedly, I think what "pretty" means is project specific. For
> example, my pretty floats print like "%.2f", because I usually don't
> need to see anything past the 3rd decimal point. When you're
> scanning a list of numbers looking for oddities, having everything
> formatted this way makes a huge difference for readability. But
> someone else will complain that everything is .99, and will find
> scientific notation more useful.
I think it's at least technically possible to provide addition
formatting behavior through newtypes (e.g. polymorphic, on RealFloat).
> Of course python's str() / repr() doesn't worry about formatting
> either. Maybe it's useful to have a Show-alike somewhere in between
> Show and Pretty.
That is basically where I was heading at.
Cheers,
Simon
More information about the Libraries
mailing list