Closed OceanOak closed 3 months ago
Questions:
Error _ -> ...
or | _ -> ...
we can add support for it in the grammar, but I am not sure how it will be captured in writtenTypes. Could you please provide some insights on this?
- What should we do about wildcard eg.
Error _ -> ...
or| _ -> ...
we can add support for it in the grammar, but I am not sure how it will be captured in writtenTypes. Could you please provide some insights on this?
It's OK to capture these as Variable match patterns.
Maybe someday we'll have a separate Wildcard MatchPattern, though -- I've thought that for a while - I'm not sure, then, what _this
would be captured as (wildcard or variable?).
- why don't we have MPDict?
I'm not sure what that would look like. I don't believe similar languages have one we could use for inspiration (besides's F#'s record pattern but I don't think it perfectly applies). I suppose the answer here is that our other match patterns are used to deconstruct structures and extract values out of them, safely, but the fields of a dict are unstable, so unsafe to deconstruct them Also, our other patterns can be checked at parse-time, whereas a dict one (if we could imagine how it looks) probably couldn't.
Changelog:
5321