Arrays of functions

You can actually really easily define yourself. In fact, this is exactly how it’s defined in Julia 1.5:

julia> f ∘ g = (x...) -> f(g(x...))
∘ (generic function with 1 method)

julia> f(x) = 2x + 1
f (generic function with 1 method)

julia> g(x) = x^2
g (generic function with 1 method)

julia> f ∘ g
#7 (generic function with 1 method)

julia> (f ∘ g)(3)
19
3 Likes