SHARE
TWEET

Untitled

a guest Jun 22nd, 2019 97 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let rec fib = n =>
  2.   switch (n) {
  3.   | 0
  4.   | 1 => 1
  5.   | x when x > 0 => fib(x - 2) + fib(x - 1)
  6.   | _ => raise(Invalid_argument("Negative value supplied to fib"))
  7.   };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top