[Haskell-cafe] Confused by instances
Fraser Wilson
blancolioni at gmail.com
Mon Apr 28 17:47:45 EDT 2008
On Mon, Apr 28, 2008 at 11:33 PM, Luke Palmer <lrpalmer at gmail.com> wrote:
>
> To answer your other question, no, there is no list show hack.
Perhaps hack was a strong word. I'm not referring to type synonyms, but to
the fact that Prelude's show class happens to have a special show function
for lists, which happens to be handy when writing an instance for Show
Char. I find the coupling here (between Show and a particular instance of
Show, namely Show Char) to be disturbing -- Show should not (if you ask me)
contain special machinery for specific instances. Not that I'll lose sleep
over it, and of course the benefit (having pretty strings) far outweighs the
philosophical cost.
The showList function has always struck me as a bit of a wart though.
cheers,
Fraser.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080428/485fb5ad/attachment.htm
More information about the Haskell-Cafe
mailing list