Generally not. In case 2, the arguments you can use the functions curryand uncurryto the extended battery for Pervasives .
Perhaps something can be prepared using the module Obj, as well as inside printf, but I will stay far from it. The difficulty is that the type system does not give you a way to express the type of a generalized function curryor uncurry. The type system does not allow you to “calculate” the length of a tuple - a 2-tuple is a 2-tuple, and you have no way to express what is (a*b*c)really (a*b)with the optional component. printfhas special support from the compiler to make the types valid, and this leads to the fact that the function type is part of the format type (therefore, similar solutions will not work for tuples).
source
share