# Ocamlformat poll for \`-\> begin\`

**URL:** https://discuss.ocaml.org/t/ocamlformat-poll-for-begin/17537
**Category:** Ecosystem
**Created:** [November 27, 2025, 2:31pm UTC](https://discuss.ocaml.org/t/ocamlformat-poll-for-begin/17537 "2025-11-27T14:31:50Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![EmileTrotignon](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/emiletrotignon/32/5913_2.png) [@EmileTrotignon](https://discuss.ocaml.org/u/EmileTrotignon)
#### Post date: [November 27, 2025, 2:31pm UTC](https://discuss.ocaml.org/t/ocamlformat-poll-for-begin/17537/1 "2025-11-27T14:31:51Z")

</div>

In the latest ocamlformat, there is a “shortcut” formatting for for begin end:

```ocaml
begin match ... with
| ... -> ...
end

```

instead of

```ocaml
begin
  match ... with
  | ... -> ...
end

```

That was a clear improvement, but it overwritten when there is a nested match - beginend - match:

```ocaml
match ... with
| ... -> begin
    match ... with
    | ...
  end

```

Do you think this should get changed to use the shortcut syntax when it can :

```ocaml
match ... with
| ... ->
    begin match ... with
    | ...
    end

```

Its also going to after other “shortcut” nodes, like `begin function` and others.

I think this is better, and I have opened a [PR](https://github.com/ocaml-ppx/ocamlformat/pull/2744) for it, but this its going to create diffs in the projects of users, we wanted to get everyone’s opinion.

_Poll ([view on site](https://discuss.ocaml.org/t/ocamlformat-poll-for-begin/17537/1))_

---

<div class="post-metadata">

### Author: ![amongonz](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@amongonz](https://discuss.ocaml.org/u/amongonz)
#### Post date: [November 27, 2025, 4:32pm UTC](https://discuss.ocaml.org/t/ocamlformat-poll-for-begin/17537/2 "2025-11-27T16:32:31Z")

</div>

I don’t know the answer but the quirks around `match`, `if`, `@@` and top-level expressions have been making me reconsider using Reason for the last few weeks. I’ve been keeping an eye on ocamlformat changes like `begin match` (which I really like!) but it feels like we’ll never reach a clean outcome. The more I learn OCaml the more I end up filling all code with begin/end.

---

<div class="post-metadata">

### Author: ![EmileTrotignon](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/emiletrotignon/32/5913_2.png) [@EmileTrotignon](https://discuss.ocaml.org/u/EmileTrotignon)
#### Post date: [November 27, 2025, 5:16pm UTC](https://discuss.ocaml.org/t/ocamlformat-poll-for-begin/17537/3 "2025-11-27T17:16:19Z")

</div>

Yeah, I would like it better if a lot of the syntax had mandatory `end` like `match x with a -> b end`

Not something thats really possible to change
