mirror of
https://github.com/c-cube/iter.git
synced 2025-12-06 11:15:32 -05:00
add Sequence.flat_map_l
This commit is contained in:
parent
5ad86a8b04
commit
2c82c3b135
2 changed files with 7 additions and 0 deletions
|
|
@ -92,6 +92,9 @@ let flatMap f seq k = seq (fun x -> f x k)
|
||||||
|
|
||||||
let flat_map = flatMap
|
let flat_map = flatMap
|
||||||
|
|
||||||
|
let flat_map_l f seq k =
|
||||||
|
seq (fun x -> List.iter k (f x))
|
||||||
|
|
||||||
let fmap f seq k =
|
let fmap f seq k =
|
||||||
seq (fun x -> match f x with
|
seq (fun x -> match f x with
|
||||||
| None -> ()
|
| None -> ()
|
||||||
|
|
|
||||||
|
|
@ -158,6 +158,10 @@ val flat_map : ('a -> 'b t) -> 'a t -> 'b t
|
||||||
element of the initial sequence, and calls {!concat}.
|
element of the initial sequence, and calls {!concat}.
|
||||||
@since 0.5 *)
|
@since 0.5 *)
|
||||||
|
|
||||||
|
val flat_map_l : ('a -> 'b list) -> 'a t -> 'b t
|
||||||
|
(** Convenience function combining {!flat_map} and {!of_list}
|
||||||
|
@since NEXT_RELEASE *)
|
||||||
|
|
||||||
val fmap : ('a -> 'b option) -> 'a t -> 'b t
|
val fmap : ('a -> 'b option) -> 'a t -> 'b t
|
||||||
(** @deprecated use {!filter_map} since 0.6 *)
|
(** @deprecated use {!filter_map} since 0.6 *)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue