For functions where the ordering of the clauses is unimportant, is it base case last:
all(Pred, [Head|Tail]) ->
case Pred(Head) of
true -> all(Pred, Tail);
false -> false
end;
all(Pred, []) when is_function(Pred, 1) -> true.
Or base case first:
all(Pred, []) when is_function(Pred, 1) -> true;
all(Pred, [Head|Tail]) ->
case Pred(Head) of
true -> all(Pred, Tail);
false -> false
end.
From looking at the source code in the standard library, it seems the convention is base case last. Is that the preferred style? Is there a reason for it, or is it just the way it is?