end_itlist

Lib.end_itlist : ('a -> 'a -> 'a) -> 'a list -> 'a

List iteration function. Applies a binary function between adjacent elements of a list.

end_itlist f [x1,...,xn] returns f x1 ( ... (f x(n-1) xn)...). Returns x for a one-element list [x].

Failure

Fails if list is empty, or if an application of f raises an exception.

Example

- end_itlist (curry op+) [1,2,3,4];
> val it = 10 : int

See also

Lib.itlist, Lib.rev_itlist, Lib.itlist2, Lib.rev_itlist2