Skip to content

Commit

Permalink
flatmap docstring fixes, NEWS
Browse files Browse the repository at this point in the history
  • Loading branch information
nlw0 committed Apr 7, 2022
1 parent f536b81 commit ea5559d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Build system changes
New library functions
---------------------

* `Iterators.flatmap` was added.

Library changes
---------------

Expand Down
5 changes: 4 additions & 1 deletion base/iterators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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...))

"""
Expand Down

0 comments on commit ea5559d

Please sign in to comment.