mirror of
https://github.com/anoma/juvix.git
synced 2024-12-15 18:13:56 +03:00
3b3ea45da9
* Renaming MiniJuvix to Juvix * Make Ormolu happy * Make Hlint happy * Remove redundant imports * Fix shell tests and add target ci to our Makefile * Make pre-commit happy
42 lines
520 B
Plaintext
42 lines
520 B
Plaintext
module Data.IO;
|
|
|
|
import Data.String;
|
|
open Data.String;
|
|
|
|
axiom Action : Type;
|
|
|
|
compile Action {
|
|
ghc ↦ "IO ()";
|
|
c ↦ "int";
|
|
};
|
|
|
|
foreign c {
|
|
int sequence(int a, int b) {
|
|
return a + b;
|
|
\}
|
|
};
|
|
|
|
infixl 1 >>;
|
|
axiom >> : Action → Action → Action;
|
|
|
|
compile >> {
|
|
ghc ↦ "(>>)";
|
|
c ↦ "sequence";
|
|
};
|
|
|
|
axiom put-str : String → Action;
|
|
|
|
compile put-str {
|
|
ghc ↦ "putStr";
|
|
c ↦ "putStr";
|
|
};
|
|
|
|
axiom put-str-ln : String → Action;
|
|
|
|
compile put-str-ln {
|
|
ghc ↦ "putStrLn";
|
|
c ↦ "putStrLn";
|
|
};
|
|
|
|
end;
|