List-flattening function in erlang feels too wordy
Little smaller than yours.

% flatten a list
my_flatten([])-&gt;
    [] ;
my_flatten([[]|T])-&gt;
    my_flatten(T);
my_flatten([[H|T]|T2])-&gt;
    my_flatten([H|[T|T2]]);
my_flatten([H|T])-&gt;
    [H|my_flatten(T)].


http://erlang99.wordpress.com/2009/01/19/p07-flatten-a-nested-list-structure/

my_flatten_rec(L)-&gt;
    lists:reverse(my_flatten_rec([],L)).
my_flatten_rec(Acc,[[]|T])-&gt;
    my_flatten_rec(Acc,T);
my_flatten_rec(Acc,[[H|T]|T2])-&gt;
    my_flatten_rec(Acc,[H|[T|T2]]);
my_flatten_rec(Acc,[H|T])-&gt;
    my_flatten_rec([H|Acc],T);
my_flatten_rec(Acc,[])-&gt;
    Acc.