[erlang-questions] List to proplist?
Wed Oct 29 14:00:31 CET 2008
> The unfold/2 below seems to take a fun. Many functions in the lists
> module take their fun as the first argument. For consistency it would
> perhaps be a good idea to let unfold/2 also takes the fun as its first
Yes. The following code was added to lists.erl:
-spec(unfold/2 :: (fun((_) -> maybe_improper_list()), any()) -> [any()]).
unfold(Splitter, State) when is_function(Splitter, 1) ->
unfold(Splitter, State, ).
unfold(Splitter, State, Acc) ->
case Splitter(State) of
unfold(Splitter, State1, [Item|Acc])
Hans Bolinder, Erlang/OTP team, Ericsson
More information about the erlang-questions