lists:all/2 documentation omission

Michael Truog <>
Fri Jul 24 06:28:13 CEST 2009

The implementation of lists:all/2 seems to contradict the documentation:
"Returns true if Pred(Elem) returns true for all elements Elem in List,
otherwise false."

because of line 938 in lib/erlang/lib/stdlib-1.16.2/src/lists.erl
all(Pred, []) when is_function(Pred, 1) -> true.

The implementation is probably what a user normally wants but the
documentation might need a slight addition to cover the empty list case.

- Michael

More information about the erlang-bugs mailing list