title: Why you can't use substitution inside a do block while you can use let (binding)?
body: <p>Why can't you use substitution inside a do block?
  This code works fine.</p>
  
  <pre><code>test :: (x -&gt; x) -&gt; [x] -&gt; [x]
  test f a = map f a
  main :: IO ()
  main = do
    let sq x = x * x :: Int
    let ret = test sq [1,2,3]
    print ret
  </code></pre>
  
  <p>But if you remove the let's inside the do block, I got compile errors.</p>
  
  <pre><code>parse error on input ‘=’
  Perhaps you need a 'let' in a 'do' block?
  e.g. 'let x = 5' instead of 'x = 5'
  </code></pre>
  
  <p>Is "let x = y" equivalent to "x &lt;- y" inside a do block?
  So if the right hand side returns a IO something, you need to use let's (or &lt;-) ?
  I know it's a dummy question but I always get compile error with this.
  eii</p>