Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let rec fib = n =>
- switch (n) {
- | 0
- | 1 => 1
- | x when x > 0 => fib(x - 2) + fib(x - 1)
- | _ => raise(Invalid_argument("Negative value supplied to fib"))
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement