Skip to content

make map ~a:(fun and map (fun consistent #2706

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

EmileTrotignon
Copy link
Collaborator

There used to be two formatting for these two syntaxes.

This makes them consistent. I picked the syntax of ~a:(fun because it was the nicest one in my opinion. (fun without label has slightly less indentation.

I would like fun exprs to always be formatted like

fun
  args
->
  body

because

fun
  args ->
  body

is just not readable: its quite hard to see were the arg ends and where the body starts.
As a comparison, we never ever do

if
  cond then
  body

I realize this is probably to large of a diff overall, but achieving it would also be both nice and make the code a lot simpler.

@EmileTrotignon EmileTrotignon requested a review from Julow April 25, 2025 19:58
(definition : Definition.t)
:
Flambda.specialised_to
-> ())
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not great but it is consistent. I would like to box the arguments, so that

fun
  arg1 arg2
  : return_type
->
  body

is allowed.

@Julow
Copy link
Collaborator

Julow commented Apr 28, 2025

This seems related to #2397

@EmileTrotignon EmileTrotignon force-pushed the fun_consistent-label branch from a83a761 to 62f5320 Compare May 14, 2025 14:54
@EmileTrotignon EmileTrotignon force-pushed the fun_consistent-label branch from 62f5320 to 56358ce Compare May 14, 2025 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants