mirror of
https://github.com/anoma/juvix.git
synced 2024-12-04 06:23:13 +03:00
98b1daec7d
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>
16 lines
454 B
Plaintext
16 lines
454 B
Plaintext
-- lifting and polymorphism
|
|
|
|
type Boxed {
|
|
Box : Π A : Type, A → Boxed A
|
|
};
|
|
|
|
def g : Π A : Type, A → Boxed A → A → A := λ(A : Type) λ(a : A) λ(_ : Boxed A) λ(a' : A) a;
|
|
|
|
def f : Π A : Type, Int → Int → Boxed A → Int → A → A :=
|
|
λ(A : Type) λ(n : Int) λ(m : Int) λ(b : Boxed A) λ(k : Int) λ(a' : A)
|
|
case b of {
|
|
Box _ a := (λ(_ : Int) g A a b a') (n + m + k);
|
|
};
|
|
|
|
f Int 0 1 (Box Int 1) 2 3
|