mirror of
https://github.com/anoma/juvix.git
synced 2024-11-30 05:42:26 +03:00
55598e0f95
* Implements code generation through Rust. * CLI: adds two `dev` compilation targets: 1. `rust` for generating Rust code 2. `native-rust` for generating a native executable via Rust * Adds end-to-end tests for compilation from Juvix to native executable via Rust. * A target for RISC0 needs to be added in a separate PR building on this one.
18 lines
480 B
Plaintext
18 lines
480 B
Plaintext
-- polymorphic type arguments
|
|
module test046;
|
|
|
|
import Stdlib.Data.Nat open;
|
|
import Stdlib.Function open;
|
|
|
|
Ty : Type := {B : Type} -> B -> B;
|
|
|
|
id' : Ty
|
|
| {_} x := x;
|
|
|
|
-- In PR https://github.com/anoma/juvix/pull/2545 we had to slightly modify
|
|
-- the `fun` definition. The previous version is kept here as a comment.
|
|
-- fun : {A : Type} → A → Ty := id λ {_ := id'};
|
|
fun {A : Type} : A → Ty := id { _ -> {C : Type} → C → C } λ {_ := id'};
|
|
|
|
main : Nat := fun 5 {Nat} 7;
|