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

Feature request for refmt: Return types on anonymous functions #2589

Closed
adamsmd opened this issue Jun 12, 2020 · 0 comments · Fixed by #2686
Closed

Feature request for refmt: Return types on anonymous functions #2589

adamsmd opened this issue Jun 12, 2020 · 0 comments · Fixed by #2686
Labels
KIND: FEATURE REQUEST Printer things that have to do with turning an AST into Reason code

Comments

@adamsmd
Copy link

adamsmd commented Jun 12, 2020

refmt moves the return types of anonymous functions after the body of the function, but I want it to put the type after the arguments of the function

Here is what I want:

(x: int): int => some_large_computation;

Here is what refmt produces:

(x: int) => (some_large_computation: int);

You can test this with:

echo '(x: int): int => some_large_computation' | refmt

I'd like refmt produce the first and not the second.

Note that ocamlformat recently made a similar change (see ocaml-ppx/ocamlformat#1368). I don't know how much refmt piggybacks on ocamlformat so that change might already implement what I am requesting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
KIND: FEATURE REQUEST Printer things that have to do with turning an AST into Reason code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants