1
1
mirror of https://github.com/anoma/juvix.git synced 2025-01-07 16:22:14 +03:00
juvix/tests/Internal/positive/Case.juvix
janmasrovira 929a8658ac
Special syntax for case (#1800)
- Closes #1716

---------

Co-authored-by: Paul Cadman <git@paulcadman.dev>
2023-02-06 14:53:35 +01:00

19 lines
364 B
Plaintext

module Case;
open import Stdlib.Prelude;
not' : Bool → Bool;
not' b := case b
| true := false
| false := true;
terminating
andList : List Bool → Bool;
andList l := case l
| nil := true
| x :: xs := x && andList xs;
main : IO;
main := printBoolLn (not' false)
>> printBoolLn (andList (true :: false :: nil));
end;