Say I have two functions:
f(x) = x^2
g(x) = x + 2
Their composition is the function
h(x) = f(g(x))
Is there an operator for function composition in Julia? For example, if *
was an operator for function composition (which it isn't), we could write:
h = f * g
P.S. I know I can define it if I want to,
*(f::Function, g::Function) = x -> f(g(x))
Just asking if there is an operator form already in Julia.
∘
operator (enter using\circ
TAB at REPL) will serve for a better math-y look. – Forebode