let
fold f =
Array
.fold_left
(
fun
v
->
function
|
None
->
v
|
Some
x
->
f v x)