fix(stream): ensure that `chain/1` preserves the order

This commit is contained in:
Andrew Mayorov 2024-06-13 14:50:43 +02:00
parent 7895e9cc45
commit 80ea2e62f7
No known key found for this signature in database
GPG Key ID: 2837C62ACFBFED5D
1 changed files with 1 additions and 1 deletions

View File

@ -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.