mirror of
https://github.com/c-cube/iter.git
synced 2025-12-06 19:25:30 -05:00
added alias 'flatten' for 'concat'
This commit is contained in:
parent
9829fc01bc
commit
e23e1f8da1
2 changed files with 5 additions and 0 deletions
|
|
@ -109,6 +109,8 @@ let concat s =
|
||||||
let k_seq seq = iter k seq in
|
let k_seq seq = iter k seq in
|
||||||
s k_seq)
|
s k_seq)
|
||||||
|
|
||||||
|
let flatten s = concat s
|
||||||
|
|
||||||
(** Monadic bind. It applies the function to every element of the
|
(** Monadic bind. It applies the function to every element of the
|
||||||
initial sequence, and calls [concat]. *)
|
initial sequence, and calls [concat]. *)
|
||||||
let flatMap f seq =
|
let flatMap f seq =
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,9 @@ val append : 'a t -> 'a t -> 'a t
|
||||||
val concat : 'a t t -> 'a t
|
val concat : 'a t t -> 'a t
|
||||||
(** Concatenate a sequence of sequences into one sequence *)
|
(** Concatenate a sequence of sequences into one sequence *)
|
||||||
|
|
||||||
|
val flatten : 'a t t -> 'a t
|
||||||
|
(** Alias for {!concat} *)
|
||||||
|
|
||||||
val flatMap : ('a -> 'b t) -> 'a t -> 'b t
|
val flatMap : ('a -> 'b t) -> 'a t -> 'b t
|
||||||
(** Monadic bind. It applies the function to every element of the
|
(** Monadic bind. It applies the function to every element of the
|
||||||
initial sequence, and calls [concat]. *)
|
initial sequence, and calls [concat]. *)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue