erg 0.6.53

The Erg programming language
Documentation
1
2
3
4
5
6
7
8
fib 0 = 0
fib 1 = 1
# a type annotation is required for the recursive function
# NOTE: currently we must specify `n` as `Int` (not `Nat`), because Erg points out the possibility that `n-1` and `n-2` could be minus
fib(n: Int): Nat = fib(n-1) + fib(n-2)

assert fib(10) == 55
print! fib 10