Commit graph

6 commits

Author SHA1 Message Date
Ayaz Hafiz
2a64b18c98
Update mono tests 2022-12-25 16:56:00 -06:00
Ayaz Hafiz
759127660d
Spread list tests can never touch exact-sized bounds tests
When compiling a pattern match like

```
[] -> ..
[_] -> ..
[_, ..] -> ..
```

to a decision tree, we must make sure that the last test (len >= 1)
does not touch the branch reached by the second test (len == 1). It is
enough to ban (len >=) tests from ever touching exact-sized list
patterns, because a spread test (len >=) can never reach an exact-sized
test.

On the other hand, an exact-sized test can reach a spread pattern,
because in

```
[_, _] -> ..
[..] -> ..
```

the last branch generates tests for patterns `[]` and `[_]`, and we would
like those patterns to be covered by the spread test (len >= 0)!

Closes #4685
2022-12-05 13:45:35 -06:00
Ayaz Hafiz
822aa71a0a
Compute list element stores lazily 2022-11-01 15:37:36 -05:00
Ayaz Hafiz
27b9dd8253
Simplify arity and branching calculation 2022-11-01 15:33:23 -05:00
Ayaz Hafiz
45f7cd5ad7
Make sure to update path of matched list 2022-11-01 15:22:31 -05:00
Ayaz Hafiz
ae71c7efe2
Decision tree compilation of list patterns 2022-11-01 15:22:31 -05:00