mirror of
https://github.com/anoma/juvix.git
synced 2024-12-12 14:28:08 +03:00
12 lines
220 B
Plaintext
12 lines
220 B
Plaintext
|
module fibo;
|
||
|
|
||
|
import Stdlib.Prelude open;
|
||
|
|
||
|
fib : Nat → Nat → Nat → Nat
|
||
|
| zero x1 _ := x1
|
||
|
| (suc n) x1 x2 := fib n x2 (x1 + x2);
|
||
|
|
||
|
fibonacci (n : Nat) : Nat := fib n 0 1;
|
||
|
|
||
|
main : IO := printNatLn (fibonacci 50);
|