Re: [Haskell-cafe] Fibbonachi numbers algorithm work TOO slow.

2007-11-07 Thread Guido Genzone
Hi, sorry my english is not the best :( 2007/11/5, gitulyar [EMAIL PROTECTED]: Please help me. I'm new in Haskell programming, but wrote some things in Scheme. I make so function: fib 1 = 1 fib 2 = 2 fib n = fib (n-1) + fib (n-2) And when I call fib 30 it works about 5 seconds. As for me

Re: [Haskell-cafe] folds with escapes

2007-07-04 Thread Guido Genzone
2007/7/4, Michael Vanier [EMAIL PROTECTED]: That's cool -- good point. takeWhile is also trivially defined in terms of foldr: takeWhile p = foldr (\x r - if p x then x:r else []) [] Can you do dropWhile in terms of foldr? I don't see how. I 'm very bad in english, sorry. Here is a