Skip to content

Commit

Permalink
if_fib: tests [if] and [let rec]
Browse files Browse the repository at this point in the history
  • Loading branch information
Glen Mével committed Feb 16, 2018
1 parent 330e0da commit 2f1fd4e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions if_fib.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
55
10 changes: 10 additions & 0 deletions if_fib.lambda
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
let rec fib = fun n ->
ifzero n then
0
else ifzero (n-1) then
1
else
fib (n-1) + fib (n-2)
in

print (fib 10)

0 comments on commit 2f1fd4e

Please sign in to comment.