[WIP] Provide ff_string:join/1 w/ no delim

This commit is contained in:
Andrey Mayorov 2018-07-05 12:48:44 +03:00
parent 19d060b755
commit 1858ee327f

View File

@ -3,19 +3,26 @@
-module(ff_string).
-export([join/1]).
-export([join/2]).
%%
-spec join(Delim, [Fragment]) -> binary() when
-type fragment() ::
iodata() |
char() |
atom() |
number() .
-spec join([fragment()]) -> binary().
join(Fragments) ->
join(<<>>, Fragments).
-spec join(Delim, [fragment()]) -> binary() when
Delim ::
char() |
iodata() ,
Fragment ::
iodata() |
char() |
atom() |
number() .
iodata() .
join(Delim, Fragments) ->
genlib_string:join(Delim, lists:map(fun genlib:to_binary/1, Fragments)).