You are viewing a single comment's thread. Return to all comments →
fib :: Int -> Int fib n = fiblist [1,0] where fiblist (x:y:zs) = if length (x:y:zs) < n then fiblist (y+x:x:y:zs) else x
Seems like cookies are disabled on this browser, please enable them to open this website
Fibonacci Numbers
You are viewing a single comment's thread. Return to all comments →