<div dir="ltr"><br><div class="gmail_quote"><div dir="ltr"><div class="gmail_quote"><div class="Ih2E3d"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Why not use the dlist library:<br>
<br>
<a href="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/dlist" target="_blank">http://hackage.haskell.org/cgi-bin/hackage-scripts/package/dlist</a><br>
<br>
With something like (untested code):<br>
<br>
> xs +++ ys = shows xs `append` shows ys<br>
> x .++ ys = showChar x `cons` shows ys<br>
> xs ++. y = shows xs `snoc` showChar y<br>
><br>
> ext3' = toList $ '(' .++ n +++ ' ' .++ s ++. ')'<br>
</blockquote></div><div><br>I think you're missing the fromList parts among other things.<br><br>That's an interesting idea. It appears to use the same idea as ShowS, but more generally with lists and not just strings.<br>
<br>I think there's an added benefit to not having to remember the the type of the value being appended. It's one of the more convenient things about many dynamically typed languages. So, I would still vote for the class-based method, so that I can use (.+.) for both Char and everything else.<br>
<br>Sean<br></div></div></div>
</div></div>