mp.erl

mp.erl — Erlang source code, 187 bytes

Continguts del fitxer

-module (mp).
-export ([map /2, map /3]).

map (_, []) -> [];
map (F, [H|T]) -> [F(H)| map(F, T)].

map (_, [], R) -> lists : reverse (R);
map (F, [H|T], R) -> map(F, T, [F(H)|R]).