Continuation-passing style in Erlang