Skip to content

Commit 19946b7

Browse files
authored
Merge pull request #1185 from Philippus/fix-typo
Fix typo
2 parents 3d7703e + da59819 commit 19946b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

_overviews/collections/iterators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ So the expression `(1 to 10).iterator.map(println)` would not print anything to
170170

171171
A consequence of this is that a method like `map` or `filter` won't necessarily apply its argument function to all of the input elements. The expression `(1 to 10).iterator.map(println).take(5).toList` would only print the values `1` to `5`, for instance, since those are only ones that will be requested from the `Iterator` returned by `map`.
172172

173-
This is one of the reasons why it's important to only use pure functions as arguments to `map`, `filer`, `fold` and similar methods. Remember, a pure function has no side-effects, so one would not normally use `println` in a `map`. `println` is used to demonstrate laziness as it's not normally visible with pure functions.
173+
This is one of the reasons why it's important to only use pure functions as arguments to `map`, `filter`, `fold` and similar methods. Remember, a pure function has no side-effects, so one would not normally use `println` in a `map`. `println` is used to demonstrate laziness as it's not normally visible with pure functions.
174174

175175
Laziness is still valuable, despite often not being visible, as it can prevent unneeded computations from happening, and can allow for working with infinite sequences, like so:
176176

0 commit comments

Comments
 (0)