1
1
mirror of https://github.com/anoma/juvix.git synced 2024-11-30 05:42:26 +03:00
juvix/tests/positive/TypeAlias.juvix
Jonathan Cubides 21d5034e60
Fix formatting for all Juvix files in tests folder (#2404)
In this PR, we ran the Juvix formatter so that we can now freely run
`make format`, `make check`, or `make pre-commit` without any unexpected
file changes.

This goes after:

- https://github.com/anoma/juvix/pull/2486
2023-10-31 18:36:34 +01:00

42 lines
715 B
Plaintext

module TypeAlias;
type T := t : T;
type T2 := t2 : T2;
alias : Type := T;
x : alias := t;
id : Type → Type
| x := x;
syntax fixity composition := binary {assoc := right};
syntax operator ⊙ composition;
⊙ : (Type → Type) → (Type → Type) → Type → Type
| f g x := f (g x);
x2 : (id ⊙ id) alias := t;
flip
: (Type → Type → Type) → id Type → Type → (id ⊙ id) Type
| 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
| a := mkPair t a a;
x' : flip Pair (id _) T2 := mkPair x t2 t;
funAlias : Type -> Type
| a := a -> a;
f : funAlias T := \ {t := t};
f' : funAlias T
| t := t;