title: Haskell: Let inside List comprehension unexpected result
body: <p>I'm new to haskell and I am trying to learn haskell. I am trying to create simple functions like "duplicate" in the most possible ways i can think. I have already done "duplicate" with pattern matching and guards.
  I can't get it working with a let inside a list comprehension.
  I can imagine let inside a list comprehension is not ideally  but I am more interested why it does not work =].</p>
  
  <p>My question is: why does duplicate' produces [Int] and duplicate'' produces [[Int]]
  and is it even possible to produce [Int] with a let inside a list comprehension?</p>
  
  <p>Thank you for your time and help :).</p>
  
  <pre><code>--list comprehension
  duplicate' xs = [y | x &lt;- xs, y &lt;- [x,x]]
  input =&gt; [1,2,3,4]
  output =&gt; [1,1,2,2,3,3,4,4]
  expected? =&gt; yes
  
  --list comprehension with let
  duplicate'' xs = [y | x &lt;- xs, let y = [x,x]]
  input =&gt; [1,2,3,4]
  output =&gt; [[1,1],[2,2],[3,3],[4,4]]
  expected? =&gt; yes
  </code></pre>