Open lukaszcz opened 3 weeks ago
Allow side conditions in pattern matches:
| pat1 pat2 pat3 if condition := body
For example, allow to write
case lst of | [x] if F x := B1 | [x] := B2 | _ := B3
instead of
case lst of | [x] := if | F x := B1 | else := B2 | _ := B3
Syntax proposal:
case lst of | [x] | if F x := A | if G x := B | else := C (else branch is optional) | _ := D;
This came up when we were writing the logic function for the simple counter application:
https://github.com/anoma/juvix-anoma-stdlib/blob/dcbc80536eadc5bc9a8b45cba259a987339dd768/examples/RawCounterTransaction.juvix#L26
Allow side conditions in pattern matches:
For example, allow to write
instead of
Syntax proposal: