[Haskell-cafe] how to make it faster ?

国平张 zhangguoping at gmail.com
Wed Mar 24 01:01:40 EDT 2010


Hi,

I wrote a type program to compute fibonacci series, if the max value
is big, then it becomes very slow.
like

take 100 fib

How can I make it faster :-)

>>>>>>>>>>>>>>>>
fibo 0 = 0
fibo 1 = 1
fibo (n+2) = (fibo n) + (fibo (n+1))
fib :: [Int]
fib = [fibo i | i <- [0..]]


More information about the Haskell-Cafe mailing list