-
Notifications
You must be signed in to change notification settings - Fork 167
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
[Feature Request] Allow operator identifiers as fields in a struct. #557
Comments
I think this is a bug since the grammar spec would allow this :-). I'll look into it. btw. even if this is fixed, it may not be what you want since
We are still experimenting with language design here; maybe we need a |
This feature request is for allowing operator identifiers to be used as fields of a struct.
The motivating example for this is the simulation of typeclasses using implicit parameters.
For example, say a "numeric" typeclass is made:
An instance of this typeclass could then be used in a function as:
However, as it stands this pattern breaks down when the function identifiers are operators, for example, this doesn't compile
with the error
And thus it is currently impossible for a typeclass to include operators, using this pattern.
I understand, however, that more considerations would have to be made about the associativity and priority of the operators, since the proposed snippet of code doesn't address that.
The text was updated successfully, but these errors were encountered: