On Wed, Sep 14, 2011 at 05:03, Kazu Yamamoto wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I would like to have an efficient implementation of the chop function.<br>

</blockquote><div><br></div><div>[...]</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Are there any more efficient implementations of chop? Any suggestions?<br>

</blockquote><div><br></div><div>  chop xs = go xs id &quot;&quot;</div><div>    where</div><div>      go &quot;&quot;     _               = id</div><div>      go (c:cs) ss | isSpace c  = go cs (ss . (:) c)</div><div>      go (c:cs) ss | otherwise  = ss . (:) c . go cs id</div>

<div> </div><div>I haven&#39;t looked at the performance, but I would like to know how well it fares.</div><div><br></div><div>Regards,</div><div>Sean</div></div>