Some people seem to think that == is an equality predicate.<br>This is a big source of confusion for them; until they realize that == is just another function returning Bool they will make claims like [1..]==[1..] having an unnatural result.
<br>The == function is only vaguely related to the equality predicate in that it is meant to be a computable approximation of semantic equality (but since it&#39;s overloaded it can be anything, of course).<br><br>&nbsp; -- Lennart
<br><br><div class="gmail_quote">On Jan 10, 2008 10:34 AM,  &lt;<a href="mailto:jerzy.karczmarczuk@info.unicaen.fr">jerzy.karczmarczuk@info.unicaen.fr</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Achim Schneider:<br><br>&gt; jerzy.karczmarczuk asks what&#39;s wrong with:<br><div class="Ih2E3d">&gt;&gt; &gt; [1..] == [1..]<br>&gt;&gt;<br>&gt;&gt; Whatever you may say more, this is neither obscure nor a bug. I still
<br>&gt;&gt; wait for a relevant example. But I don&#39;t insist too much...<br>&gt;&gt;<br>&gt; It&#39;s not an example of a bug, but of a cause.<br><br></div>A cause of WHAT?? This is a perfect, nice, runaway computation, which
<br>agrees with all dogmas of my religion.<br><br>Now, if somebody says that the fact that some people find it difficult to<br>grasp the essence of laziness, and THIS is a source of bugs, I may believe.<br>But not the laziness itself. (For some people the (==) operator seems to
<br>be a permanent source of bugs.)<br><br>The difference between fold and stricter fold&#39; won&#39;t convince me either.<br>People who want to use laziness must simply read the documentation...<br><br>On the other hand, what Don Stewart pointed out, the inconsistency between
<br>enumFrom and enumFromTo, and the difference of behaviours when one passes<br>from Int to Integer, now, this is another story, worrying a little...<br>Thanks.<br><br><br>Perhaps another example is more relevant, the tradeoffs space-time in the
<br>&quot;optimized&quot; version of the powerset generator...<br><br>Jerzy Karczmarczuk<br><div><div></div><div class="Wj3C7c"><br><br>_______________________________________________<br>Haskell-Cafe mailing list<br><a href="mailto:Haskell-Cafe@haskell.org">
Haskell-Cafe@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br></div></div></blockquote></div><br>