View Problem

Split a list of things into numbers and non-numbers

Given a list that might contain e.g. a string, an integer, a float and a date,
split the list into numbers and non-numbers.
DiskEdit
erlang
% Wrapped call to the auxiliary function
number_split(Xs) ->
number_split(Xs, [], []).

% The auxiliary function
number_split([], Num, NonNum) ->
{Num, NonNum};
number_split([X|Xs], Num, NonNum) ->
case is_number(X) of
true ->
number_split(Xs, [X|Num], NonNum);
false ->
number_split(Xs, Num, [X|NonNum])
end.
DiskEdit
erlang
List = ["hello", 25, 3.14, calendar:local_time()],
{Numbers, NonNumbers} = lists:partition(fun(E) -> is_number(E) end, List)

Submit a new solution for erlang
There are 10 other solutions in additional languages (csharp, fsharp, groovy, java ...)