Hi, <div>  I think 3 &lt; genericLength [1..] should fail, that laziness is not we want. <br>  I can not derive ListLike  instance using GHC extensions, can you provide a working example?</div><div>  Thanks<br><div class="gmail_quote">
On Tue, Aug 23, 2011 at 9:47 PM, Ivan Lazar Miljenovic <span dir="ltr">&lt;<a href="mailto:ivan.miljenovic@gmail.com">ivan.miljenovic@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 24 August 2011 11:10, bob zhang &lt;<a href="mailto:bobzhang1988@gmail.com">bobzhang1988@gmail.com</a>&gt; wrote:<br>
&gt; Hi, John, there is a space leak problem in ListLike typeclass,<br>
&gt; in the method genericLength<br>
&gt; calclen !accum cl =<br>
&gt; calclen accum cl =<br>
<br>
</div>I _think_ this may cause problems with some data types (e.g.<br>
<a href="http://hackage.haskell.org/packages/archive/numbers/2009.8.9/doc/html/Data-Number-Natural.html" target="_blank">http://hackage.haskell.org/packages/archive/numbers/2009.8.9/doc/html/Data-Number-Natural.html</a><br>

) that require the extra laziness (that is, you can do things like ` 3<br>
&lt; genericLength [1..] &#39; and have it return True).<br>
<div class="im"><br>
&gt; --- thank you for your nice library<br>
&gt; btw, is there any way to derive ListLike interface automatically?<br>
&gt; for such type :<br>
&gt; newtype List a = List {[a]}<br>
<br>
</div>GeneralizedNewtypeDeriving can do that.<br>
<font color="#888888"><br>
--<br>
Ivan Lazar Miljenovic<br>
<a href="mailto:Ivan.Miljenovic@gmail.com">Ivan.Miljenovic@gmail.com</a><br>
<a href="http://IvanMiljenovic.wordpress.com" target="_blank">IvanMiljenovic.wordpress.com</a><br>
</font></blockquote></div><br><br clear="all"><div><br></div>-- <br>Best, bob<br>
</div>