Skip to content

Commit

Permalink
Add example for broadcasted ∘ (#47007)
Browse files Browse the repository at this point in the history
and update the last example so that order of application is relevant
  • Loading branch information
LilithHafner committed Oct 10, 2022
1 parent 6904559 commit 7bd8311
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions base/operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -969,15 +969,21 @@ julia> map(uppercase∘first, ["apple", "banana", "carrot"])
'B': ASCII/Unicode U+0042 (category Lu: Letter, uppercase)
'C': ASCII/Unicode U+0043 (category Lu: Letter, uppercase)
julia> (==(6)∘length).(["apple", "banana", "carrot"])
3-element BitVector:
0
1
1
julia> fs = [
x -> 2x
x -> x/2
x -> x-1
x -> x/2
x -> x+1
];
julia> ∘(fs...)(3)
3.0
2.0
```
See also [`ComposedFunction`](@ref), [`!f::Function`](@ref).
"""
Expand Down

0 comments on commit 7bd8311

Please sign in to comment.