`Ast_builder.Default.pexp_tuple` on empty list
Ast_builder.Default.pexp_tuple, etc. currently have a special case for the one-element list:
https://github.com/ocaml-ppx/ppxlib/blob/6baf858275937bfafa05c8ce958f0e75ced00262/src/ast_builder.ml#L91-L99
I wonder if it makes sense to also have a special case for the empty list, degrading to () instead. Right now calling them with the empty list yields an error from deeper down that a tuple needs at least 2 elements.
Or maybe there's a reason this generalization hasn't been made? The existence _opt versions of these functions hints at the need to distinguish the empty list case.
Thanks for the issue! I wasn't sure myself, so I've just had a look at the compiler Parsetree module. There are few Parsetree invariants that aren't enforced by the type checker. They're written down as comments in the compiler Parsetree module. There's one for Pexp_tuple: n>=2. That explains the behavior of ppat_tuple and why ppat_tuple_opt exists.
It would be quite valuable to add documentation about that in Ast_builder though. Do you want to do that?