fix(stream): ensure that `chain/1` preserves the order
This commit is contained in:
parent
7895e9cc45
commit
80ea2e62f7
|
@ -190,7 +190,7 @@ transpose_tail(S, Tail) ->
|
|||
%% @doc Make a stream by concatenating multiple streams.
|
||||
-spec chain([stream(X)]) -> stream(X).
|
||||
chain(L) ->
|
||||
lists:foldl(fun chain/2, empty(), L).
|
||||
lists:foldr(fun chain/2, empty(), L).
|
||||
|
||||
%% @doc Make a stream by chaining (concatenating) two streams.
|
||||
%% The second stream begins to produce values only after the first one is exhausted.
|
||||
|
|
Loading…
Reference in New Issue