let cb_opted f v = match f with
    | None -> ()
    | Some f -> f v ; ()