You are viewing a single comment's thread. Return to all comments →
One liner:
fib = ((++) [0, 1] [fib (n-2) + fib (n-1) | n <-[2..] ] !!)
Though I presume your solution would be faster since it uses ":"
Seems like cookies are disabled on this browser, please enable them to open this website
Fibonacci
You are viewing a single comment's thread. Return to all comments →
One liner:
fib = ((++) [0, 1] [fib (n-2) + fib (n-1) | n <-[2..] ] !!)
Though I presume your solution would be faster since it uses ":"