mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
deprecate CCOpt.to_seq, provide to_iter instead
This commit is contained in:
parent
bd4e4d311d
commit
78ef007b77
2 changed files with 10 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue