1
1
mirror of https://github.com/anoma/juvix.git synced 2024-11-30 05:42:26 +03:00
juvix/tests/positive/AliasRecordConstructor.juvix
Łukasz Czajka 161a34c36b
Optional braces in case syntax (#2778)
* Closes #2769 
* Removes old case syntax
* Pretty printing doesn't print braces in `case` if the `case` is a
"top" expression in a definition.
2024-05-22 18:14:03 +01:00

24 lines
332 B
Plaintext

module AliasRecordConstructor;
type A := a;
type T := mkT {field : A};
syntax alias mkT' := mkT;
t : T :=
mkT'@{
field := a
};
t1 : T -> A
| mkT'@{field := x} := x;
syntax iterator it {init := 0; range := 1};
it : (A → A) → T → A
| _ (mkT a) := a;
syntax alias it' := it;
t2 (t : T) : A := it' (a in t) a;