title: Sum of Fibonacci numbers
body: <p>I'm rather new to Haskell. The problem is to find the sum of all even Fibonacci numbers not greater than 4 million. I can't use lists. </p>
  
  <p>If I understand correctly, the below solution is wrong, because it uses lists:</p>
  
  <pre><code>my_sum = sum $ filter (odd) $ takeWhile (&lt; 4000000) fibs
  </code></pre>
  
  <p>Where <em>fibs</em> is the list of all Fibonacci numbers.</p>
  
  <p>Somehow, I find it difficult not to think in Haskell in terms of lists. Could anyone guide me to a solution to this problem?</p>
  
  <p>Regards</p>
  
  <p>EDIT:</p>
  
  <p>If anyone is interested, I've solved this problem. Here is the code (very clumsy-looking, but works nevertheless):</p>
  
  <pre><code>findsum threshold = findsum' 0 1 0 threshold
  
  
  findsum' n1 n2 accu t 
  | n2 &gt; t    = accu
  | odd n2    = findsum' n2 n3 accu t 
  | otherwise = findsum' n2 n3 accu2 t
  where
      n3 = n2 + n1
      accu2 = accu + n2
  </code></pre>