If f were defined as fabc () = ... , you could just do a (fabc) , but other than that, thereβs a shorter way.
If you want to define the const function as follows:
let const x _ = x
And then use it like this:
a (const (fabc))
But this is actually not much shorter (or clearer) than using fun . It also evaluates fabc immediately, which is probably not the way you want it.
PS: The pedant in me should indicate that (fun () -> ...) is a unary function and there are no zero sequence functions in ocaml.
sepp2k
source share