Skip to main content

Questions tagged [pattern-matching]

For questions about designing or implementing pattern matching, a language feature for inspecting values against patterns that describe groups of values

10 votes
6 answers
2k views

Consider the following example in Rust: ...
kaya3's user avatar
  • 22.4k
9 votes
1 answer
388 views

In his original paper on Views for Pattern Matching, Philip Wadler describes them as bidirectional: the definition of a view had both in and ...
Daphne Preston-Kendal's user avatar
5 votes
1 answer
365 views

As far as I can tell pattern matching was first proposed as a language feature by Burstall (1969). However, it was a proposal for a feature in the language ISWIM, which itself never had a completed ...
Daphne Preston-Kendal's user avatar
5 votes
1 answer
360 views

An algorithm to decide pattern match coverage can be complete by computing the complement for each case. For example: Nat The primitive constructors are ...
林子篆's user avatar
7 votes
3 answers
627 views

In some languages that support pattern matching, there is a feature that allows you to match against multiple patterns at once. This is called "or patterns" in Python 3.10. For example, you ...
alephalpha's user avatar
0 votes
4 answers
287 views

How do different languages do pattern matching? In Rust it's match x { y => ..., z => ... } However in ocaml it's ...
a coder's user avatar
  • 695