Util_pure.List
val sngl : 'a -> 'a t
val iter_flip : 'a t -> ('a -> unit) -> unit
val of_table : ('a, 'b) BatMap_real.t -> ('a * 'b) t
val to_table : ('a * 'b) t -> ('a, 'b) BatMap_real.t
val repeat_f : int -> (unit -> 'a) -> 'a t
val repeat : int -> 'a -> 'a t
The opposite of cons, and reversed: `unsnoc a; b; c
` gives `(a; b
, c)`. Throws on empty list.
The opposite of cons, and reversed: `unsnoc a; b; c
` gives `(a; b
, c)`. Throws on empty list.
Given a function g
and a list of functions fs
, find the first one for which g (f ())
is true, and return Some (f ())
. If none of them match, return None
.
val find_f : ('a -> bool) -> (unit -> 'a) t -> 'a option
Given a function g
and a list of functions fs
, find the first one for which g (f ())
is true, and return Some (f ())
. If none of them match, return None
.