title: List comprehension in haskell with let and show, what is it for?
body: <p>I'm studying project euler solutions and this is the solution of problem 4, which asks to </p>
  
  <blockquote>
    <p>Find the largest palindrome made from the product of two 3-digit
    numbers</p>
  </blockquote>
  
  <pre><code>problem_4 =
    maximum [x | y&lt;-[100..999], z&lt;-[y..999], let x=y*z, let s=show x, s==reverse s]
  </code></pre>
  
  <p>I understand that this code creates a list such that <code>x</code> is a product of all possible <code>z</code> and <code>y</code>. </p>
  
  <p>However I'm having a problem understanding what does <code>s</code> do here. Looks like everything after <code>|</code> is going to be executed everytime a new element from this list is needed, right? </p>
  
  <p>I don't think I understand what's happening here. Shouldn't everything to the right of <code>|</code> be constraints?</p>