@@ -76,7 +76,7 @@ defmodule Stream do
76
76
There are many functions in Elixir's standard library that return
77
77
streams, some examples are:
78
78
79
- * `IO.stream/1 ` - Streams input lines, one by one;
79
+ * `IO.stream/2 ` - Streams input lines, one by one;
80
80
* `URI.query_decoder/1` - Decodes a query string, pair by pair;
81
81
82
82
This module also provides many convenience functions for creating streams,
@@ -195,7 +195,7 @@ defmodule Stream do
195
195
from `pad` if it was passed. If `pad` is passed and does not
196
196
have enough elements to fill the chunk, then the chunk is
197
197
returned anyway with less than `n` elements. If `pad` is not
198
- passed at all or is nil, then the partial chunk is discarded
198
+ passed at all or is ` nil` , then the partial chunk is discarded
199
199
from the result.
200
200
201
201
## Examples
@@ -231,7 +231,7 @@ defmodule Stream do
231
231
@ doc """
232
232
Chunks the `enum` by buffering elements for which `fun` returns
233
233
the same value and only emit them when `fun` returns a new value
234
- or the `enum` finishes,
234
+ or the `enum` finishes.
235
235
236
236
## Examples
237
237
@@ -305,7 +305,7 @@ defmodule Stream do
305
305
306
306
@ doc """
307
307
Lazily drops elements of the enumerable while the given
308
- function returns true.
308
+ function returns ` true` .
309
309
310
310
## Examples
311
311
@@ -363,10 +363,10 @@ defmodule Stream do
363
363
end
364
364
365
365
@ doc """
366
- Creates a stream that filters and then map elements according
367
- to given funtions .
366
+ Creates a stream that filters and then maps elements according
367
+ to given functions .
368
368
369
- It exists for simmetry with Enum.filter_map/3.
369
+ Exists for symmetry with ` Enum.filter_map/3` .
370
370
371
371
## Examples
372
372
@@ -398,7 +398,7 @@ defmodule Stream do
398
398
399
399
@ doc """
400
400
Creates a stream that applies the given function to each
401
- element, emits the result and uses the same result as accumulator
401
+ element, emits the result and uses the same result as the accumulator
402
402
for the next computation.
403
403
404
404
## Examples
@@ -415,8 +415,8 @@ defmodule Stream do
415
415
416
416
@ doc """
417
417
Creates a stream that applies the given function to each
418
- element, emits the result and uses the same result as accumulator
419
- for the next computation. Uses the given `acc` as starting value.
418
+ element, emits the result and uses the same result as the accumulator
419
+ for the next computation. Uses the given `acc` as the starting value.
420
420
421
421
## Examples
422
422
@@ -512,7 +512,7 @@ defmodule Stream do
512
512
513
513
## Examples
514
514
515
- Open up a file, replace all # by % and stream to another file
515
+ Open up a file, replace all `#` by `%` and stream to another file
516
516
without loading the whole file in memory:
517
517
518
518
stream = File.stream!("code")
@@ -536,7 +536,7 @@ defmodule Stream do
536
536
For such, the collection is fully enumerated keeping up to `2 * n`
537
537
elements in memory. Once the end of the collection is reached,
538
538
the last `count` elements will be executed. Therefore, using
539
- a negative `n` in an infinite collection will never return.
539
+ a negative `n` on an infinite collection will never return.
540
540
541
541
## Examples
542
542
@@ -592,7 +592,7 @@ defmodule Stream do
592
592
@ doc """
593
593
Creates a stream that takes every `n` item from the enumerable.
594
594
595
- The first item is always included, unless n is 0.
595
+ The first item is always included, unless `n` is 0.
596
596
597
597
## Examples
598
598
@@ -610,7 +610,7 @@ defmodule Stream do
610
610
611
611
@ doc """
612
612
Lazily takes elements of the enumerable while the given
613
- function returns true.
613
+ function returns ` true` .
614
614
615
615
## Examples
616
616
@@ -625,10 +625,10 @@ defmodule Stream do
625
625
end
626
626
627
627
@ doc """
628
- Creates a stream that only emits elements if they are uniq .
628
+ Creates a stream that only emits elements if they are unique .
629
629
630
630
Keep in mind that, in order to know if an element is unique
631
- or not, this function needs to store all uniq values emitted
631
+ or not, this function needs to store all unique values emitted
632
632
by the stream. Therefore, if the stream is infinite, the number
633
633
of items stored will grow infinitely, never being garbage collected.
634
634
@@ -649,7 +649,7 @@ defmodule Stream do
649
649
650
650
@ doc """
651
651
Creates a stream where each item in the enumerable will
652
- be accompanied by its index.
652
+ be wrapped in a tuple alongside its index.
653
653
654
654
## Examples
655
655
@@ -859,7 +859,7 @@ defmodule Stream do
859
859
Successive values are generated by calling `next_fun` with the
860
860
previous accumulator (the initial value being the result returned
861
861
by `start_fun`) and it must return a tuple with the current and
862
- next accumulator. The enumeration finishes if it returns nil.
862
+ next accumulator. The enumeration finishes if it returns ` nil` .
863
863
864
864
As the name says, this function is useful to stream values from
865
865
resources.
@@ -911,7 +911,7 @@ defmodule Stream do
911
911
912
912
Successive values are generated by calling `next_fun` with the previous
913
913
accumulator and it must return a tuple with the current and next
914
- accumulator. The enumeration finishes if it returns nil.
914
+ accumulator. The enumeration finishes if it returns ` nil` .
915
915
916
916
## Examples
917
917
0 commit comments