1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-20 05:12:05 +03:00
juvix/examples/milestone/Fibonacci/Fibonacci.juvix
Łukasz Czajka 2baad15a41 Remove old function syntax (#2305)
* Enables new function syntax in local let-declarations
* Closes #2251
2023-08-24 16:24:47 +02:00

12 lines
249 B
Plaintext

module Fibonacci;
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 := readLn (printNatLn ∘ fibonacci ∘ stringToNat);