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

transform ocaml pervasives interfaces to reason correctly #1474

Merged
merged 1 commit into from Oct 10, 2017
Merged

transform ocaml pervasives interfaces to reason correctly #1474

merged 1 commit into from Oct 10, 2017

Conversation

GuillaumeSalles
Copy link
Contributor

@GuillaumeSalles GuillaumeSalles commented Oct 8, 2017

Currently on master:

$ echo "val ( = ) : 'a -> 'a -> bool" | refmt --parse=ml --print=re --interface=true

Actual result

let (=): ('a, 'a) => bool;

Expected result

let (==): 'a => 'a => bool;

I think there is 2 issues here :

  • (=) should mapped to (==)
  • 'a -> 'a should not become a tupple

This PR fixes only the first one. The second one seems to be a regression.

Currently the Pervasives reason documentation page is misleading and I think this PR will fix it. E.g. https://reasonml.github.io/api/Pervasives.html#VAL(=)

And probably that one too #1427

I'm still a new to OCaml / Reason so feel free to tell me if I misunderstood something.

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@hcarty
Copy link
Contributor

hcarty commented Oct 8, 2017

This looks like it may fix #1427 - thank you!

The tuple-looking syntax is due to a major syntax change in master. See #1299 for more details.

@GuillaumeSalles
Copy link
Contributor Author

The tuple-looking syntax is due to a major syntax change in master. See #1299 for more details.

Oh I see! Thanks for the info.

@chenglou
Copy link
Member

Looks good! Thanks, I'll merge it. This indeed fixes #1427.

You can map over signature_item directly btw: http://caml.inria.fr/pub/docs/manual-ocaml/libref/Ast_mapper.html#TYPEmapper

No need to pick signature then do List.map on it yourself. I'll correct it.

@chenglou chenglou merged commit 2ebfff9 into reasonml:master Oct 10, 2017
chenglou added a commit to chenglou/reason that referenced this pull request Oct 10, 2017
chenglou added a commit that referenced this pull request Oct 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants