1
1
mirror of https://github.com/anoma/juvix.git synced 2024-11-30 05:42:26 +03:00
juvix/tests/positive/NestedPatterns.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

15 lines
274 B
Plaintext

module NestedPatterns;
import Stdlib.Prelude open;
type MyList (A : Type) := myList : List A -> MyList A;
toList : {A : Type} -> MyList A -> List A
| (myList xs) := xs;
f : MyList Nat -> Nat
| xs :=
case toList xs of
| suc n :: nil := n
| _ := zero;