Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement operator consistency checks #6

Open
forestbelton opened this issue Sep 19, 2017 · 0 comments
Open

Implement operator consistency checks #6

forestbelton opened this issue Sep 19, 2017 · 0 comments

Comments

@forestbelton
Copy link
Owner

An operator definition consists of a sequence of clauses, each with a corresponding type signature.

If the values on the top of the stack can be coerced into the signature required by the clause, the clause is chosen. In case of more than one match, the first matching clause in the sequence is chosen.

There are a few checks which help ensure that clauses don't "interfere" with each other. These checks need to be re-implemented in the new PureScript core.

  • Ensure clauses are listed in "most-specific-first" order, such that for all every clause c_i, the length of c_i's signature is greater than or equal to c_(i+1)'s signature.
  • Ensure clauses do not overwrite each other. If the signature of clause c_i can be coerced to a suffix of any previous clause's signature, then it is subsumed by the previous clause and will never be executed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant