Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Optional argument type not printed #7866
In some cases the type of an optional argument cannot be printed.
This is because the type of the argument becomes
Comment author: @alainfrisch
I assume that the trouble is that the printer does not have access to the environment in order to unify the argument type with 'a option in order to extract 'a. Is that right? Could one use the environment provided by wrap_printing_env?
Do you mean splitting:
| Tarrow of arg_label * type_expr * type_expr * commutable
in two constructors (or putting the first type_expr "under" the three constructors), so that the first type_expr can be given a different meaning?
Comment author: @lpw25
Essentially, although I would phrase it more in terms of wanting type printing to work without needing to perform invasive operations like unification on the types.
I had in mind making the first type_expr part of the label type, and giving it a slightly different meaning in the optional case. It just seems a cleaner representation to me, but its probably a fairly invasive change.