1
1
mirror of https://github.com/anoma/juvix.git synced 2025-01-05 22:46:08 +03:00
juvix/tests/VampIR/positive/Core/test024.jvc
Łukasz Czajka 336a934d18
Normalization by Evaluation (#2038)
* Closes #2032.
* Adds the `juvix dev core normalize` command.
* Adds the `:n` command in JuvixCore REPL.
* Adds the `--normalize` flag to `juvix dev core read` and `juvix dev
core from-concrete`.
* Adds `pipeline-normalize` which denotes pipeline steps necessary
before normalization.
* Adds normalization tests in `tests/VampIR/positive/Core`.
2023-05-15 18:01:40 +02:00

16 lines
444 B
Plaintext

-- eta-expansion of polymorphic constructors
type Void {
void : Π T : Type, Void T;
};
type Box {
box : Π T : Type, Π A : Type, Void T → A → A → Box A;
};
def f : Box Int → Int := \(x : Box Int) case x of { box _ _ _ a b := b - a };
def g : Int -> Int -> (Int → Int → Box Int) → Box Int := \(x2 : Int) \(x3 : Int) \(f : Int → Int → Box Int) f x2 x3;
\(x2 : Int) \(x3 : Int)
f (g x2 x3 (box Int Int (void Int)))