diff --git a/NEWS.md b/NEWS.md index 60eb4a5ed06b4..cfd37786dbda4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -34,6 +34,8 @@ Build system changes New library functions --------------------- +* `Iterators.flatmap` was added. + Library changes --------------- diff --git a/base/iterators.jl b/base/iterators.jl index ccb910afa5758..ba3fbeb19f022 100644 --- a/base/iterators.jl +++ b/base/iterators.jl @@ -1167,6 +1167,10 @@ last(f::Flatten) = last(last(f.it)) Equivalent to `flatten(map(f, iterators...))`. +See also [`Iterators.flatten`](@ref), [`Iterators.map`](@ref). + +!!! compat: "Julia 1.9" + # Examples ```jldoctest julia> Iterators.flatmap(n->-n:2:n, 1:3) |> collect @@ -1182,7 +1186,6 @@ julia> Iterators.flatmap(n->-n:2:n, 1:3) |> collect 3 ``` """ -# flatmap = flatten ∘ map flatmap(f, c...) = flatten(map(f, c...)) """