3 ms·
Good question. The answer is that Hare does not have real pattern matching as you may understand it. The switch statement switches on values, and the match stat
by ddevault 4y ago
Good question. The answer is that Hare does not have real pattern matching as you may understand it. The switch statement switches on values, and the match statement switches on types. Merging these faces two problems: one is that the grammar does not support types and values appearing in the same place, and the other is that it would imply either dependent types or a hack similar to them, which we're not really interested in. But I can see that on the surface, the distinction appears a bit arbitrary.