package colibri2
fold_product f acc l1 l2
apply the function f
with the accumulator acc
on all the pair of elements of l1
and l2
tail-recursive
generalisation of Lists.fold_product
not tail-recursive
product l1 l2
create on all the pair of elements of l1
and l2
tail-recursive
part cmp l
returns the list of the congruence classes with respect to cmp
. They are returned in reverse order
first f l
returns the first result of the application of f
to an element of l
which doesn't return None
. raise
Not_found
if all the element of l
return None
find_nth p l
returns the index of the first element that satifies the predicate p
. raise Not_found
if no element of l
verify the predicate
The combinaison of list_first
and list_find_nth
.
similar to List.map, List.iter and List.fold_left, but with element index passed as extra argument (in 0..len-1)
removes the first n elements of a list; raises Invalid_argument if the list is not long enough
return :
- the reverse the last n elements of a list;
- return the remaining part of the list.
- if the list is not long enough return the number of elements needed (
0
otherwise )