-
Notifications
You must be signed in to change notification settings - Fork 428
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
(++) can't be used as an operator since it turns into (^) #2309
Comments
In this case they are swapped, so you can use
Outputs:
If you like |
I don't mind which operator symbol it uses as long as I can use it. In this case, your suggestion does not seem to work:
Happy to put some time into this if you can point me in the right direction. |
You're right and you can see here which tokens are swapped for which tokens: |
I think what we could do is allow prefixing the That would always give you a way to refer to any ML function identifier like:
Then you could use the same Sometimes when formatting an identifier with a trailing |
#1944 should fix this when I get around to incorporating the suggested changes. |
Problem:
The following OCaml input to
refmt
does not translate back to the same OCaml.OCaml Input:
Reason Output / Input:
OCaml Output:
This means that libraries like
notty
can not be used, because they only define a(++)
operator and no alternative function with a name.Proposed solution:
Perhaps preserving all operators is impossible at this stage, but it'd be great if I didn't have to redefine operators because the OCaml output is different than what I'm expecting.
Alternatively, providing a cheatsheet of what operators will be replaced by what (and a way to circumvent it) would be a very nice gesture.
E.g,
(++)
(^)
(^)
(!)
(!)
not
???
(++)
The text was updated successfully, but these errors were encountered: