mirror of
https://github.com/anoma/juvix.git
synced 2024-12-27 01:23:32 +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);
|