Here's my try (not tested). It scans the list once, stops early, and all the hard work is made by library functions! categorize(P, [X|Xs]) -> case P(X) of true -> case lists:all(P, Xs) of true -> all false -> some end false -> case lists:any(P, Xs) of true -> some false -> none end end. Cheers P.