How does haskell create a new list from another list?
<p>Suppose we have a list</p>

<pre><code>x = [1..10]
</code></pre>

<p>and we intend to create another list y using this in this manner :</p>

<pre><code>y= [a|a&lt;-x]
</code></pre>

<p>So while creating the list <code>y</code> from <code>x</code>, it accesses each element of <code>x</code>( from 1 to 10) and inserts it in <code>y</code> in the same order. As a list in haskell is singly linked list, we can insert a new element only at its head. So first it inserts 1 to <code>[]</code> &amp; we have <code>[1]</code>. Then it inserts 2 to its head &amp; so we have <code>[2,1]</code>. Then it inserts 3 &amp; we have <code>[3,2,1]</code> &amp; so on. So ultimately we should get <code>y</code> as <code>[10,9..1]</code>. But instead we get <code>y</code> as <code>[1..10]</code>. Why is that so?</p>