2021-08-19 00:54:43 +03:00
|
|
|
Tests an issue where pattern matching matrices involving built-in
|
|
|
|
types was discarding default cases in some branches.
|
|
|
|
|
2024-07-10 17:46:18 +03:00
|
|
|
``` unison
|
2021-08-19 00:54:43 +03:00
|
|
|
f = cases
|
|
|
|
0, 0 -> 0
|
|
|
|
_, 1 -> 2
|
|
|
|
1, _ -> 3
|
|
|
|
_, _ -> 1
|
|
|
|
|
|
|
|
> f 0 0
|
|
|
|
> f 1 0
|
|
|
|
> f 0 1
|
|
|
|
> f 1 1
|
|
|
|
```
|
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2021-08-19 00:54:43 +03:00
|
|
|
|
2023-12-22 14:55:24 +03:00
|
|
|
Loading changes detected in scratch.u.
|
|
|
|
|
2021-08-19 00:54:43 +03:00
|
|
|
I found and typechecked these definitions in scratch.u. If you
|
|
|
|
do an `add` or `update`, here's how your codebase would
|
|
|
|
change:
|
|
|
|
|
|
|
|
⍟ These new definitions are ok to `add`:
|
|
|
|
|
|
|
|
f : Nat -> Nat -> Nat
|
|
|
|
|
|
|
|
Now evaluating any watch expressions (lines starting with
|
|
|
|
`>`)... Ctrl+C cancels.
|
|
|
|
|
|
|
|
7 | > f 0 0
|
|
|
|
⧩
|
|
|
|
0
|
|
|
|
|
|
|
|
8 | > f 1 0
|
|
|
|
⧩
|
|
|
|
3
|
|
|
|
|
|
|
|
9 | > f 0 1
|
|
|
|
⧩
|
|
|
|
2
|
|
|
|
|
|
|
|
10 | > f 1 1
|
|
|
|
⧩
|
|
|
|
2
|
|
|
|
|
|
|
|
```
|