You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into this recently, too, so I have been thinking about it.
The difference is due to a notion of trying a match versus committing to the match. Without |, there is only one choice, and so you might as well commit to matching arguments as you go. With multiple |s (and, currently, even for just one |), then later arguments may fail to match, in which case matching will move on to the next |, so a call doesn't commit to any match until all are arguments can match. Binding happens after committing, so that's why bindings are unavailable.
In principle, it's a difference between | or not. But my conclusion so far is that this distinction is trying too hard to avoid work, and would be less confusing no worse in practice to commit to matching each argument individually — even if an argument-match result is discarded by moving on to another | clause.
a
ina == b
is unbound, but the following code is fineThe text was updated successfully, but these errors were encountered: