Skip to content

Instantly share code, notes, and snippets.

@0culus
Created November 12, 2014 23:02
Show Gist options
  • Select an option

  • Save 0culus/052f08d0b418c9d8066a to your computer and use it in GitHub Desktop.

Select an option

Save 0culus/052f08d0b418c9d8066a to your computer and use it in GitHub Desktop.
F# fibonacci with pattern matching!
// compute fibonacci numbers with F#
module fibonacci =
let rec fib n =
match n with
| 0 -> 0
| 1 -> 1
| _ -> fib(n - 1) + fib(n - 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment