1
1
mirror of https://github.com/anoma/juvix.git synced 2024-11-30 14:13:27 +03:00
juvix/tests/Core/positive/test039.jvc
Łukasz Czajka 98b1daec7d
Print JuvixCore correctly (#1875)
Print JuvixCore InfoTable in such a way that it can be parsed back by
the JuvixCore parser.

* Depends on PR #1832 
* Depends on PR #1862 
* Closes #1841 
* Adds "JuvixCore print" tests which read the files from
Core/positive/*.jvc, print them, read them back and check if the
evaluation results are preserved.

---------

Co-authored-by: Jan Mas Rovira <janmasrovira@gmail.com>
2023-03-15 16:41:39 +01:00

28 lines
441 B
Plaintext

-- eta-expansion of builtins and constructors
type stream {
cons : Any -> Any -> stream;
};
def f := \g g 2;
def f' := \x f (+ x);
def g := \f f 2;
def g' := \x g (cons x);
def f1 := \g g 2;
def f1' := \x \y f (+ (x / y));
def g1 := \f f 2;
def g1' := \x \y g (cons (x / y));
def h := \f f 1 2;
def writeLn := \x write x >> write "\n";
writeLn (f' 7) >>
writeLn (g' 7) >>
writeLn (f1' 7 2) >>
writeLn (g1' 7 2) >>
writeLn (h cons)