-
Notifications
You must be signed in to change notification settings - Fork 4
Description
We should allow patterns in places where we currently only allow variable binders.
I think the full list of these places currently is: let
binders and function arguments.
The type of the patterns should be a product type (named or anonymous), otherwise give a type error. We don't want to pattern match and we don't want to fail, we just want to make field selection convenient/concise.
I'm tentatively labeling this as "good first issue" as this is just coding. Potential issues:
-
The interpreter's parser cannot be modified too much currently, almost everything causes LR(1) issues. If this is the case, we can implement this only in the compiler.
This is easy to try: just replace variable binders with the pattern non-terminal and see if it breaks.
-
Formatting may not be ideal with patterns in function argument positions and we may need to tweak it a little bit.