Additional parameters are described in Section 6.7 of the OCaml manual. Here is what he says:
View function
fun ? lab :( pattern = expr0 ) -> expr
equivalently
fun ? lab : ident ->
let pattern = match ident with
| Some ident -> ident
| None -> expr0
in
expr
where ident is a fresh variable, except that it is not specified when calculating expr 0.
This shows what expr0is evaluated on each call if an additional parameter is not specified. Ie, expr0is inside the lambda, not the outside.
source
share