I have some erlang functions that utilize guards.
I don't /have/ to expose all of these, but I would like to.
i2s(I) ->
integer_to_list(I).
a2s(A) ->
atom_to_list(A).
n2s(A) when is_float(A) -> f2s(A);
n2s(A) when is_integer(A) -> i2s(A);
n2s([]) -> [];
n2s([H|T]) -> [n2s(H)," "|n2s(T)].
f2s(I) when is_integer(I) ->
i2s(I);
f2s(F) ->
remove_leading_blanks(flatten(io_lib:format("~8.2f", [F]))).
remove_leading_blanks([$\s|T]) -> remove_leading_blanks(T);
remove_leading_blanks(X) -> X.
flatten(L) ->
binary_to_list(list_to_binary(L)).