<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>
 &nbsp; &nbsp;<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>
&nbsp;&gt; xs +++ ys = shows &nbsp; &nbsp;xs `append` shows &nbsp; &nbsp;ys<br>
&nbsp;&gt; x &nbsp;.++ ys = showChar x &nbsp;`cons` &nbsp; shows &nbsp; &nbsp;ys<br>
&nbsp;&gt; xs ++. y &nbsp;= shows &nbsp; &nbsp;xs `snoc` &nbsp; showChar y<br>
&nbsp;&gt;<br>
&nbsp;&gt; ext3&#39; = toList $ &#39;(&#39; .++ n +++ &#39; &#39; .++ s ++. &#39;)&#39;<br>
</blockquote></div><div><br>I think you&#39;re missing the fromList parts among other things.<br><br>That&#39;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&#39;s an added benefit to not having to remember the the type of the value being appended. It&#39;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>