@@ -90,11 +90,21 @@ defmodule Stream do
90
90
This module also provides many convenience functions for creating streams,
91
91
like `Stream.cycle/1`, `Stream.unfold/2`, `Stream.resource/3` and more.
92
92
93
- Note the functions in this module are guaranteed to return enumerables.
94
- Since enumerables can have different shapes (structs, anonymous functions,
95
- and so on), the functions in this module may return any of those shapes
96
- and this may change at any time. For example, a function that today
97
- returns an anonymous function may return a struct in future releases.
93
+ > #### Do not check for `Stream` structs
94
+ >
95
+ > While some functions in this module may return the `Stream` struct,
96
+ > you must never explicitly check for the `Stream` struct, as streams
97
+ > may come in several shapes, such as `IO.Stream`, `File.Stream`, or
98
+ > even `Range`s.
99
+ >
100
+ > The functions in this module only guarantee to return enumerables
101
+ > and their implementation (structs, anonymous functions, etc) may
102
+ > change at any time. For example, a function that returns an anonymous
103
+ > function today may return a struct in future releases.
104
+ >
105
+ > Instead of checking for a particular type, you must instead write
106
+ > assertive code that assumes you have an enumerable, using the functions
107
+ > in the `Enume` or `Stream` module accordingly.
98
108
"""
99
109
100
110
@ doc false
0 commit comments