mirror of
https://github.com/anoma/juvix.git
synced 2024-12-14 17:32:00 +03:00
29 lines
319 B
Plaintext
29 lines
319 B
Plaintext
|
module Data.Int;
|
||
|
|
||
|
open import Data.String;
|
||
|
|
||
|
axiom Int : Type;
|
||
|
compile Int {
|
||
|
c ↦ "int";
|
||
|
};
|
||
|
|
||
|
axiom intToStr : Int → String;
|
||
|
|
||
|
compile intToStr {
|
||
|
c ↦ "intToStr";
|
||
|
};
|
||
|
|
||
|
foreign c {
|
||
|
int plus(int l, int r) {
|
||
|
return l + r;
|
||
|
\}
|
||
|
};
|
||
|
|
||
|
infixl 6 +;
|
||
|
axiom + : Int -> Int -> Int;
|
||
|
compile + {
|
||
|
c ↦ "plus";
|
||
|
};
|
||
|
|
||
|
end;
|