Allow underscore patterns to be named. #111
Labels
accepted
The issue has been reviewed and accepted for implementation
good first issue
Good for newcomers
help wanted
Extra attention is needed
language proposal
proposal of a major feature to the language
Milestone
As we know,
_
is used to meanignore this value
in a pattern, sometimes in acase
expression, sometimes as one of the arguments to a function.Haskell, and I think a few others, allow you to spell this as
_
followed by any valid unqualified identifier.This allows something like the following:
or
I've always personally quite liked this. I like that it says something like "I'm ignoring the key here", as opposed to "I'm ignoring something".
One possible downside is that such names can become misleading after the thing that is matched is changed.
The text was updated successfully, but these errors were encountered: