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

No way to call infix => function defined in OCaml #1941

Open
Schmavery opened this issue May 18, 2018 · 1 comment · May be fixed by #1944
Open

No way to call infix => function defined in OCaml #1941

Schmavery opened this issue May 18, 2018 · 1 comment · May be fixed by #1944
Labels
OCaml->Reason Parser parsing reason code into an AST

Comments

@Schmavery
Copy link
Contributor

I'm using an OCaml library that defines the infix operator "=>" from my reason project and I can't figure out how to use it. Is there any way to escape it so that it doesn't get interpreted in the reason way?

I'd be ok if I couldn't use it as an infix in Reason and had to rebind it or something but it would be nice not to have to fork the OCaml library.

Is there some trick I'm missing?

@hcarty
Copy link
Contributor

hcarty commented May 18, 2018

It's a bit of a hack, but you could have a .ml file which does the rebinding then pull the operator from that. That should at least be lighter weight than forking the OCaml library. This does sound like a bug in Reason though, maybe a missing operator escaping case.

infixhack.ml

let ( ==> ) = ( => )

main.re

open Infixhack;
/* Code using ==> */

anmonteiro added a commit to anmonteiro/reason that referenced this issue May 20, 2018
This PR applies the same solution that we use for `/\*` and makes `=\>` work

fixes reasonml#1941
@anmonteiro anmonteiro linked a pull request May 20, 2018 that will close this issue
anmonteiro added a commit to anmonteiro/reason that referenced this issue May 28, 2018
This PR applies the same solution that we use for `/\*` and makes `=\>` work

fixes reasonml#1941
anmonteiro added a commit to anmonteiro/reason that referenced this issue May 30, 2018
This PR applies the same solution that we use for `/\*` and makes `=\>` work

fixes reasonml#1941
anmonteiro added a commit to anmonteiro/reason that referenced this issue Jun 3, 2018
This PR applies the same solution that we use for `/\*` and makes `=\>` work

fixes reasonml#1941
@jaredly jaredly added OCaml->Reason Parser parsing reason code into an AST labels Jun 14, 2018
anmonteiro added a commit to anmonteiro/reason that referenced this issue Oct 11, 2018
This PR applies the same solution that we use for `/\*` and makes `=\>` work

fixes reasonml#1941
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCaml->Reason Parser parsing reason code into an AST
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants