Closed Pyrolistical closed 2 years ago
Yes, the second match clause is subsumed by the first, but as you note, it's meant to just illustrate the behavior. Multiple match expressions could be used, but I don't think they'd meaningfully improve the example, just make it longer. Both clauses are already "useless", after all - the match expression is being used as a statement, but neither clause has side effects.
Here is the with chaining example.
I understand it is intended to explain the with chaining, but it is ill-formed.
I am fairly certain, the first when clause will always match and second when clause never matches. I believe the second when clause is there just to show the with chaining syntax. However overall it is a non-sensentical match expression. It would have been more clear by having two separate match expressions.
Also
MyClass = {
is invalid syntax.