Binding `len = length xs` and then calculating `len` causes GHC to consume lots of RAM : <p>I found a strange thing about GHCi and lists.</p>

<p>This command takes some time to execute and just returns the right answer.</p>

<pre><code>ghci&gt; length [1..10^8]
100000000
</code></pre>

<p>However, binding this to a variable and executing causes GHC to consume about 5 GiB of RAM without releasing until the GHCi session is over. Typing <code>:quit</code> after it consumes 3 GiB more before actually exiting.</p>

<pre><code>ghci&gt; len = length [1..10^8]
ghci&gt; len
-- Consumes 5 GiB
100000000
ghci&gt; :quit
-- Consumes 3 GiB
-- Exits
</code></pre>

<p>Is this normal? What is the difference between the commands?</p>

<p>GHC version is 8.2.2.</p>
