Function composition for Erlang