<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">Le 07/02/2015 02:48, Jeffrey Brown a
écrit :<br>
</div>
<blockquote
cite="mid:CAEc4Ma0S7shSqG7WmPD3Y6krGBMbx+59-it+Y7OvOfV2Wq=k1Q@mail.gmail.com"
type="cite">
<div dir="ltr"> I see: what matters is that ++ has to traverse to
the end of the first list. The order in which its two arguments
are evaluated is irrelevant.<br>
<br>
Thank you, David and Arjun!<br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Fri, Feb 6, 2015 at 5:38 PM, Arjun
Comar <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:nrujac@gmail.com" target="_blank">nrujac@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Jeff,<br>
An expression of the form xs ++ [x] appends the element to
the end of the list. In order to evaluate the result, the
++ function iterates through the elements of the first
list to find the end of the list then sets the tail of the
last element of the first list to the second list. </div>
</blockquote>
</div>
</div>
</blockquote>
Gentlemen, don't forget that Haskell is lazy, and this traversal
takes place only when the list is effectively traversed by a
consumer, which stores everything (and doesn't get rid of elements
read). This might be the case here if somebody wants to keep and use
the "digit representation" of a number, but please do not consider
this phenomenon as inherent to the list creation algorithm.<br>
<br>
Jerzy Karczmarczuk<br>
<br>
</body>
</html>