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: Return types on anonymous functions #1368

Closed
adamsmd opened this issue May 20, 2020 · 0 comments · Fixed by #1381
Closed

Feature request: Return types on anonymous functions #1368

adamsmd opened this issue May 20, 2020 · 0 comments · Fixed by #1381

Comments

@adamsmd
Copy link

adamsmd commented May 20, 2020

Is your feature request related to a problem? Please describe.

There might already be an option for this, but I haven't been able to find one. If there is, please let me know.

ocamlformat 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:

fun (x : int) : int -> some_large_computation

Here is what ocamlformat produces:

fun (x : int) -> (some_large_computation : int)

You can test this with:

echo 'fun (x: int): int -> some_large_computation' | ocamlformat --impl --enable-outside-detected-project -

Describe the solution you'd like

I'd like an option that makes ocamlformat produces the first and not the second.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant