[Haskell-cafe] Advice for clean code.

Dougal Stanton ithika at gmail.com
Tue Dec 4 05:26:29 EST 2007

On 04/12/2007, Felipe Lessa <felipe.lessa at gmail.com> wrote:
> I always thought show was meant for returning a String that could be
> used to recreate the original data if you copy-pasted it in your code
> or if you used read (i.e. read . show == id). Reading the
> documentation more carefully, I see that [1] says that this property
> holds for *derived* instances, and says nothing about it in the
> general case.
> So, what's the deal here? May I use Show for anything without breaking
> conventions? And how about Read?

That seems to be convention though I don't think it's required for the
correct operation of anything. Anyone?

Dougal Stanton
dougal at dougalstanton.net // http://www.dougalstanton.net

More information about the Haskell-Cafe mailing list