1
1
mirror of https://github.com/anoma/juvix.git synced 2025-01-07 16:22:14 +03:00
juvix/examples/milestone/Fibonacci/Fibonacci.juvix
janmasrovira 803d2008d9
remove ≔ from the language and replace it by := (#1563)
* remove ≔ from the language and replace it by :=

* revert accidental changes in juvix input mode

* update stdlib submodule

* rename ℕ by Nat in the tests and examples

* fix shell tests
2022-09-30 10:55:32 +10:00

16 lines
259 B
Plaintext

module Fibonacci;
open import Stdlib.Prelude;
fib : Nat → Nat → Nat → Nat;
fib zero x1 _ := x1;
fib (suc n) x1 x2 := fib n x2 (x1 + x2);
fibonacci : Nat → Nat;
fibonacci n := fib n 0 1;
main : IO;
main := putStrLn (natToStr (fibonacci 25));
end;