title: Haskell Multi-line Lambdas
body: <p>I am learning Haskell from learnyouahaskell.com and there is an example such that:</p>
  
  <pre><code>search :: (Eq a) =&gt; [a] -&gt; [a] -&gt; Bool  
  search needle haystack =   
      let nlen = length needle  
      in  foldl (\acc x -
  &gt; if take nlen x == needle then True else acc) False (tails haystack) 
  </code></pre>
  
  <p>But when tried this code with GHC, it gives me </p>
  
  <pre><code>error: parse error on input ‘-’
  </code></pre>
  
  <p>But it works when it is like this:</p>
  
  <pre><code>search :: (Eq a) =&gt; [a] -&gt; [a] -&gt; Bool  
  search needle haystack =   
      let nlen = length needle  
      in  foldl (\acc x -&gt; if take nlen x == needle then True else acc) False (tails haystack) 
  </code></pre>
  
  <p>Is there a feature of Haskell that allows multi-line lambdas or is that something I am missing?</p>