Skip to content

Instantly share code, notes, and snippets.

@vasily-kirichenko
Created June 29, 2012 18:02
F# Fibonacci
let rec fib n =
match n with
|0|1 -> n
|x when x > 0 -> fib(x - 1) + fib(x - 2)
for x in 0..39 do
printfn "fib(%d) = %d" x (fib x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment