File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -66,11 +66,14 @@ defmodule Enum do
66
66
iex> Enum.map(dict, fn { k, v } -> { k, v * 2 } end)
67
67
[a: 2, b: 4]
68
68
69
- Note that the `Enum` module is eager: it always evaluates the whole collection
70
- and returns a list as result. The `Stream` module allows lazy enumeration of
71
- collections and also provides infinite streams. Infinite streams needs to be
72
- carefully used with `Enum` functions as they can potentially run forever, for
73
- example:
69
+ Note the functions in the `Enum` module are eager: they always start
70
+ the enumeration of the given collection. The `Stream` module allows
71
+ lazy enumeration of collections and also provides infinite streams.
72
+
73
+ Since the majority of the functions in `Enum` enumerate the whole
74
+ collection and return a list as result, infinite streams need to
75
+ be carefully used with such functions, as they can potentially run
76
+ forever, for example:
74
77
75
78
Enum.each Stream.cycle([1,2,3]), &IO.puts(&1)
76
79
You can’t perform that action at this time.
0 commit comments