Skip to content

Conversation

@EmileTrotignon
Copy link
Collaborator

Instead of

match () with
| () -> begin
    match () with
    | () ->
  end
end

you get

match () with
| () ->
    begin match () with
    | () ->
    end
end

Same thing with if-then-else

Copy link
Collaborator

@Julow Julow left a comment

Choose a reason for hiding this comment

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

This is an other large change to the formatting of begin .. end. I think we should let the community debate and vote for a formatting that will stay for a while.
Or perhaps, this should be behind an option ?

CHANGES.md Outdated

### Changed

- \* allow shortcut `begin end` in `match` cases and `if then else` body. (#2744, @EmileTrotignon)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think "allow" here is ambiguous. Do you change the formatting for everyone or is here an other allowed formatting ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I change it everywhere, use would be better

@EmileTrotignon
Copy link
Collaborator Author

We can make a topic on discuss, I would rather not introduce a new option.

@EmileTrotignon
Copy link
Collaborator Author

Another thing to point regarding making "big changes" is that after releasing 0.28, we had some negative feedback, but all of it was about bugs/regressions, none of it was people complaining about the intended changes. So I think the reception was clearly positive.

@EmileTrotignon
Copy link
Collaborator Author

Discuss poll here

@EmileTrotignon
Copy link
Collaborator Author

Results of the poll are clearly in favour of the change

Copy link
Collaborator

@Julow Julow left a comment

Choose a reason for hiding this comment

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

Awesome :)

Can you fix the conflicts and merge ?

| A -> begin
match B with
| A ->
begin match B with A -> fooooooooooooo
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 should be fixed by #2745

@EmileTrotignon EmileTrotignon merged commit 0a805f2 into ocaml-ppx:main Dec 2, 2025
10 of 12 checks passed
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