File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -247,6 +247,21 @@ struct Filter{F,I}
247
247
itr:: I
248
248
end
249
249
250
+ """
251
+ Iterators.filter(flt, itr)
252
+
253
+ Given a predicate function `flt` and an iterable object `itr`, return an
254
+ iterable object which upon iteration yields the elements `x` of `itr` that
255
+ satisfy `flt(x)`. The order of the original iterator is preserved.
256
+
257
+ This function is *lazy*; that is, it is guaranteed to return in ``Θ(1)`` time
258
+ and use ``Θ(1)`` additional space, and `flt` will not be called by an
259
+ invocation of `filter`. Calls to `flt` will be made when iterating over the
260
+ returned iterable object. These calls are not cached and repeated calls will be
261
+ made when reiterating.
262
+
263
+ See [`Base.filter`](@ref) for an eager implementation of filtering for arrays.
264
+ """
250
265
filter (flt, itr) = Filter (flt, itr)
251
266
252
267
start (f:: Filter ) = start_filter (f. flt, f. itr)
You can’t perform that action at this time.
0 commit comments