List.concat comme synonyme de List.flatten
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1303 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
c6a124c998
commit
867222bf4f
|
@ -43,6 +43,8 @@ let rec flatten = function
|
|||
[] -> []
|
||||
| l::r -> l @ flatten r
|
||||
|
||||
let concat = flatten
|
||||
|
||||
let rec map f = function
|
||||
[] -> []
|
||||
| a::l -> let r = f a in r :: map f l
|
||||
|
|
|
@ -27,6 +27,7 @@ val nth : 'a list -> int -> 'a
|
|||
Raise [Failure "nth"] if the list is too short. *)
|
||||
val rev : 'a list -> 'a list
|
||||
(* List reversal. *)
|
||||
val concat : 'a list list -> 'a list
|
||||
val flatten : 'a list list -> 'a list
|
||||
(* Catenate (flatten) a list of lists. *)
|
||||
|
||||
|
|
Loading…
Reference in New Issue