Skip to content

Commit 50619b1

Browse files
authored
Clarify the interplay of Stream and Enum (#14002)
1 parent bb028b9 commit 50619b1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/elixir/lib/stream.ex

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@ defmodule Stream do
3131
Due to their laziness, streams are useful when working with large
3232
(or even infinite) collections. When chaining many operations with `Enum`,
3333
intermediate lists are created, while `Stream` creates a recipe of
34-
computations that are executed at a later moment. Let's see another
35-
example:
34+
computations that are executed at a later moment. Then when the
35+
stream is consumed later on, most commonly by using a function in
36+
the `Enum` module, the stream will emit its elements one by one.
37+
38+
Let's see another example:
3639
3740
1..3
3841
|> Enum.map(&IO.inspect(&1))

0 commit comments

Comments
 (0)