I try this (using Core):
Some 9
|> Option.value_exn
|> printf "%d\n"
But the interpreter says:
Line 2, characters 9-25:
Error: This expression has type
?here:Base__Source_code_position0.t ->
?error:Base.Error.t -> ?message:string -> 'a option -> 'a
but an expression was expected of type int option -> 'b
"This expression" here refers to Option.value_exn
.
Is it impossible to use a function like value_exn
that has named parameter with default values, pipelining in the single non-named parameter, without manually specifying all the named parameters?