let map_option o ~f = begin match o with | None -> return None | Some s -> f s >>< begin function | `Ok o -> return (Some o) | `Error e -> fail e end end