List.concat comme synonyme de List.flatten

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1303 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Xavier Leroy 1997-02-25 14:41:37 +00:00
parent c6a124c998
commit 867222bf4f
2 changed files with 3 additions and 0 deletions

View File

@ -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

View File

@ -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. *)