-
Notifications
You must be signed in to change notification settings - Fork 25
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
Heterogeneous ==
#130
Milestone
Comments
it also makes sense in the context of unification between facts: if we're matching between facts, and the term we are matching on has different types on both sides, they do not match, but it does not blow up the entire execution |
This was referenced May 12, 2024
Merged
4 tasks
Geal
added a commit
to biscuit-auth/biscuit-rust
that referenced
this issue
May 26, 2024
…220) Context: biscuit-auth/biscuit#130 This introduces the `HeterogeneousEqual` and `HeterogeneousNotEqual` operations, which will not return an error when their operands have different types, contrary to the existing `Equal` and `NotEqual` operations. **breaking change**: this does not change the execution of existing tokens, but changes the text representation of the language. `Equal` was `==` and is now `===`, `NotEqual` was `!=` and is now `!==`, `HeterogeneousEqual` is `==` and `HeterogeneousNotEqual` is `!=` --------- Co-authored-by: Geoffroy Couprie <[email protected]> Co-authored-by: Clément Delafargue <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, the haskell and rust implementations (amongst others) produce an error on the following expression:
1 == true
.While this makes sense to refuse this expression in a typed language (the equivalent expression would not type check in rust or haskell), this behaviour is a bit more surprising in an untyped langage where such an expression would usually evaluate to false instead of blowing up.
The specification does not explicitly cover this case, and i think it should.
My preference would go to have heterogeneous equality comparisons to not blow up and evaluate to false for two reasons:
Term
sum type, which defines==
by first comparing the constructors, and then values if the constructors are the same (this is why 2. holds).The text was updated successfully, but these errors were encountered: