Juntando-se a uma lista de binários em Erlang

-spec binary_join(List :: list(binary()), Separator :: binary()) -> binary().
binary_join
(List, Separator) ->
lists
:foldl(fun(Item, Acc) ->
if
bit_size
(Acc) > 0 -> <<Acc/binary, Separator/binary, Item/binary>>;
true -> Item
end
end, <<>>, List).