I see lots of opportunities for a sufficiently smart match to optimize this, but I don't think match can do them with just ? and app without trying doing an unreasonable amount of analysis to the procedure expressions.
(Writing this also made me think about how the potential choices might interact with and and or patterns.)
I also don't love the words "full" and "partial". I've been thinking of the word "exhaustive", but I'm not sure if the analogy to "exhaustiveness checking" would be helpful or confusing.
I like “open” and “closed” better, so I will use those.
It’s been a week now. The results of both polls are: 9 vs 5 and 7 vs 3 for “closed” vs “open”. So the consensus seems to be having “closed” by default for hash.
I think I already have enough information from the RFC to start implementing the pattern. Of course, if you have any disagreement with the upcoming PR, you can still raise your concern there.
@LiberalArtist: When I said there’s no efficiency gain, I simply described the current state (of the existing hash-table and the proposed hash and hash*). With more effort, you can certainly add more optimization.
The second pattern in your code snippet is interesting. It is not possible to directly express it in the proposed patterns. However, you can do the following (assuming that options can't be false):
I circled back on this in the process of looking something else up and was wondering where things stood? I use match an awful lot, and this particular feature would be very useful for me.
The PR is now merged! The feature is in the snapshot build now (docs here), so you can try it out if you want to.
Thanks everyone in this thread for the RFC participation. Special thanks to @samth for the PR review!