<br><br><div class="gmail_quote">On 12 March 2010 14:28, Thomas Davie <span dir="ltr">&lt;<a href="mailto:tom.davie@gmail.com">tom.davie@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="word-wrap: break-word;"><div class="im"><br><div><div>On 12 Mar 2010, at 14:25, Salil Wadnerkar wrote:</div><br><blockquote type="cite"><div>On Fri, Mar 12, 2010 at 10:21 PM, Ozgur Akgun &lt;<a href="mailto:ozgurakgun@gmail.com" target="_blank">ozgurakgun@gmail.com</a>&gt; wrote:<br>
<blockquote type="cite">Another boring variant from me then.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">isHomogeneous xs = all (first==) xs<br></blockquote><blockquote type="cite">    where first = head xs<br>
</blockquote><br><br>Shouldn&#39;t<br>head xs<br>give an exception on an empty list?<font color="#000000"><font color="#144fae"><br></font></font></div></blockquote><br></div></div><div>An error, and only if it&#39;s evaluated.  Lazy evaluation means it&#39;s not evaluated here.</div>
<div><br></div><div>Of course another non-strict algorithm *might* evaluate head xs here, so this version won&#39;t work in all possible Haskell implementations, only the current ones which use lazy evaluation.</div><div>
<br></div><div>Bob</div></div></blockquote></div><br><br>So we need to make sure our code would work in a strict environment, even though we are using a lazily evaluated language, just in case if someone comes up with a not-that-lazy implementation of haskell?<br>
<br>If I was thinking this way, I would just stop using haskell at all.<br><br clear="all"><br>-- <br>Ozgur Akgun<br>