I'm just wondering if there is a ready implementation of zip-function in the standart erlang library. Something like that:
zip([H1|T1], [H2|T2], Acc)->
zip(T1, T2, Acc ++ [{H1, H2}]);
zip([], [], Acc) ->
Acc.
I'm just wondering if there is a ready implementation of zip-function in the standart erlang library. Something like that:
zip([H1|T1], [H2|T2], Acc)->
zip(T1, T2, Acc ++ [{H1, H2}]);
zip([], [], Acc) ->
Acc.
There is a zip function in the lists module:
> lists:zip([a,b,c], [1,2,3]).
[{a,1},{b,2},{c,3}]