'zip' in Erlang

I'm just wondering if there is a ready-made implementation of the zip function in the erlang standard library. Something like that:

zip([H1|T1], [H2|T2], Acc)->
    zip(T1, T2, Acc ++ [{H1, H2}]);
zip([], [], Acc) ->
    Acc.
+3
source share
1 answer

There is a zip function in the list module :

> lists:zip([a,b,c], [1,2,3]).
[{a,1},{b,2},{c,3}]
+15
source

Source: https://habr.com/ru/post/1724809/


All Articles