added alias 'flatten' for 'concat'

This commit is contained in:
Simon Cruanes 2013-03-08 18:09:22 +01:00
parent 9829fc01bc
commit e23e1f8da1
2 changed files with 5 additions and 0 deletions

View file

@ -109,6 +109,8 @@ let concat s =
let k_seq seq = iter k seq in
s k_seq)
let flatten s = concat s
(** Monadic bind. It applies the function to every element of the
initial sequence, and calls [concat]. *)
let flatMap f seq =

View file

@ -101,6 +101,9 @@ val append : 'a t -> 'a t -> 'a t
val concat : 'a t t -> 'a t
(** 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
(** Monadic bind. It applies the function to every element of the
initial sequence, and calls [concat]. *)