partition : ('a -> bool) -> 'a list -> 'a list * 'a list
- SYNOPSIS
-
Separates a list into two lists using a predicate.
- DESCRIPTION
-
partition p l returns a pair of lists. The first list contains the elements
which satisfy p. The second list contains all the other elements.
- FAILURE CONDITIONS
-
Never fails.
- EXAMPLE
-
# partition (fun x -> x mod 2 = 0) (1--10);;
val it : int list * int list = ([2; 4; 6; 8; 10], [1; 3; 5; 7; 9])
- SEE ALSO
-
chop_list, remove, filter.