title: Haskell: nested parens vs. dot notation
body: <p>Problem 2 of Project Euler says:
  Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:</p>
  
  <p>1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...</p>
  
  <p>By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.</p>
  
  <p>GHCi parses this solution just fine:</p>
  
  <pre><code>fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
  p002fibsum x = sum (filter even (takeWhile (&lt; (x+1)) fibs))
  </code></pre>
  
  <p>...but it has a problem with this one:</p>
  
  <pre><code>fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
  p002fibsum x = sum . filter even . takeWhile (&lt; (x+1)) fibs
  
  Couldn't match expected type `a1 -&gt; [c0]' with actual type `[a0]'
  In the return type of a call of `takeWhile'
  Probable cause: `takeWhile' is applied to too many arguments
  In the second argument of `(.)', namely
    `takeWhile (&lt; (x + 1)) fibs'
  In the second argument of `(.)', namely
    `filter even . takeWhile (&lt; (x + 1)) fibs'
  </code></pre>
  
  <p>takeWhile seems to take only two params, which seem to be the right amount.  Am I failing because of a missing type signature?  How can I get this solution to work with dot notation?</p>