This commit introduce the type arrow_flag in place of string to represent labelled arguments.
Previously, labelled arguments where encoded as a string tagging the left hand-side of an arrow type:
"" is the absence of label, "?ident" for optional arguments, "ident" for labelled arguments.
The arrow_flag variant now brings more structure to function arguments.
The purpose is two fold: offers a proper encoding of labels rather than relying on string processing, and ease further extensions of arrow lhs.
The text was updated successfully, but these errors were encountered:
Shouldn't we take this opportunity to clean up Pexp_fun, which seems a little bit weird, with an "expression option" argument that can be non-None only when the arg_label is Optional. We could introduce another type:
type fun_label =
| Labelled of string
| Optional of string * expression option
and replace the two first arguments of Pexp_fun/Pcl_fun with one of this type.