mirror of
https://github.com/anoma/juvix.git
synced 2024-12-15 01:52:11 +03:00
17 lines
268 B
Plaintext
17 lines
268 B
Plaintext
module Data.Nat;
|
||
inductive ℕ {
|
||
zero : ℕ;
|
||
suc : ℕ → ℕ;
|
||
};
|
||
|
||
infixl 6 +;
|
||
+ : ℕ → ℕ → ℕ;
|
||
+ zero b ≔ b;
|
||
+ (suc a) b ≔ suc (a + b);
|
||
|
||
infixl 7 *;
|
||
* : ℕ → ℕ → ℕ;
|
||
* zero b ≔ zero;
|
||
* (suc a) b ≔ b + a * b;
|
||
|
||
end; |