Difficulties with type inferences and optional / tagged arguments are described in the Ocaml manual . It mentions that the correct way to solve the problem is to give an explicit type indication for the nasty argument, in this case Option.value_exn. Really
Some(1) |> (Option.value_exn : int option -> int);;
works. The manual further explains that
, , - , , , , None
, Option.value_exn . , , ,
let f ?(message = "") x = x in 1 |> f;;
.