mirror of
https://github.com/c-cube/iter.git
synced 2025-12-06 03:05:29 -05:00
iterate on booleans
This commit is contained in:
parent
3ab300eea6
commit
80e9057a00
2 changed files with 6 additions and 0 deletions
|
|
@ -578,6 +578,8 @@ let int_range ~start ~stop k =
|
|||
let int_range_dec ~start ~stop k =
|
||||
for i = start downto stop do k i done
|
||||
|
||||
let bools k = k false; k true
|
||||
|
||||
let of_set (type s) (type v) m set =
|
||||
let module S = (val m : Set.S with type t = s and type elt = v) in
|
||||
fun k -> S.iter k set
|
||||
|
|
|
|||
|
|
@ -422,6 +422,10 @@ val int_range_dec : start:int -> stop:int -> int t
|
|||
(** Iterator on decreasing integers in [stop...start] by steps -1.
|
||||
See {!(--^)} for an infix version *)
|
||||
|
||||
val bools : bool t
|
||||
(** Iterates on [true] and [false]
|
||||
@since NEXT_RELEASE *)
|
||||
|
||||
val of_set : (module Set.S with type elt = 'a and type t = 'b) -> 'b -> 'a t
|
||||
(** Convert the given set to a sequence. The set module must be provided. *)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue