blob: 5b7e66b76c0f388cb6bea0b5c1b5208c3311433a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
|
effect fib
ctl fib(n : int) : int
fun doFib(inp : int) : div int
with ctl fib(n)
if n == 0 then 0
else if n == 1 then 1
else (doFib(n - 1) : int) + doFib(n - 2)
fib(inp)
fun main()
print(doFib(20))
|