deprecate CCOpt.to_seq, provide to_iter instead

This commit is contained in:
Simon Cruanes 2019-11-20 17:50:22 -06:00
parent bd4e4d311d
commit 78ef007b77
2 changed files with 10 additions and 1 deletions

View file

@ -204,10 +204,12 @@ let to_gen o =
let first = ref true in
fun () -> if !first then (first:=false; o) else None
let to_seq o k = match o with
let to_iter o k = match o with
| None -> ()
| Some x -> k x
let to_seq = to_iter
let pp ppx out = function
| None -> Format.pp_print_string out "None"
| Some x -> Format.fprintf out "@[Some %a@]" ppx x

View file

@ -186,6 +186,13 @@ val choice_seq : 'a t sequence -> 'a t
@since 0.13 *)
val to_gen : 'a t -> 'a gen
val to_iter : 'a t -> 'a sequence
(** Returns an internal iterator, like in the library [Iter].
@since NEXT_RELEASE *)
val to_seq : 'a t -> 'a sequence
(** Previous name for {!to_iter}
@deprecated use {!to_iter} instead *)
val pp : 'a printer -> 'a t printer