mirror of
https://github.com/anoma/juvix.git
synced 2024-12-12 04:43:18 +03:00
3fbc9c7c55
Closes #1644 #1635
38 lines
563 B
Plaintext
38 lines
563 B
Plaintext
module TypeAlias;
|
|
|
|
type T :=
|
|
t : T;
|
|
|
|
type T2 :=
|
|
t2 : T2;
|
|
|
|
alias : Type;
|
|
alias := T;
|
|
|
|
x : alias;
|
|
x := t;
|
|
|
|
id : Type → Type;
|
|
id x := x;
|
|
|
|
infixr 9 ⊙;
|
|
⊙ : (Type → Type) → (Type → Type) → Type → Type;
|
|
⊙ f g x := f (g x);
|
|
|
|
x2 : (id ⊙ id) alias;
|
|
x2 := t;
|
|
|
|
flip : (Type → Type → Type) → id Type → Type → (id ⊙ id) Type;
|
|
flip f a b := f b a;
|
|
|
|
type Pair (A : Type) (B : Type) :=
|
|
mkPair : id T → id (id A) → B → Pair A B;
|
|
|
|
p : {A : Type} → A → Pair A A;
|
|
p a := mkPair t a a;
|
|
|
|
x' : flip Pair (id _) T2;
|
|
x' := mkPair x t2 t;
|
|
|
|
end;
|