Skip to content

Pattern guards and disjunctive patterns #42

@ratmice

Description

@ratmice

I didn't see an issue for this, I hope it isn't retreading anything,

the summary of proposed changes contains both disjunctive patterns, and pattern guards. In the (very succinct!) paper ambiguous pattern variables by Scherer et al, from the ML workshop 2016, this combination lead to patterns whose interpretation probably won't match a users naive expectation.

In the case of Ocaml this lead to a new warning, I have yet to look at the proposed semantics for Successor ML to figure out if it is impacted, or if there is an terrible solution such as evaluating the guard twice which would work. As such, not really proposing anything, but thought it should be discussed.

Edit: Initially I had the thought that such cases could be resolved by expanding the pattern guard to evaluate to is_neutral n orelse is_neutral n' after alpha conversion, but this direction seems real misguided so I struck that out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions