Comment on Static, Ahead of Time Compiled JuliaparentComments−PeCaN10yNo, x |> f is equivalent to f(x) while (f ∘ g)(x) is equivalent to g(f(x)). Specifically, x |> f results in a value (of the type of the return value of f) while f ∘ g results always results in a function.−g0wda10yWhy not make one for yourself? ;)julia> (∘)(f, g) = x -> f(g(x))∘ (generic function with 1 method)julia> (sum ∘ rand)(10)3.397728240035534Tip: type \circ<tab> to get ∘−PeCaN10yI know, but why isn't something like this in core? * did function composition a while ago, but it was removed (beats me why) and hasn't been replaced.Enough Perl6 has left me with <compose>(.) to get ∘ :-)−CyberDildonics10yGet involved then, Julia isn't exactly the illuminate.
Comments
No, x |> f is equivalent to f(x) while (f ∘ g)(x) is equivalent to g(f(x)). Specifically, x |> f results in a value (of the type of the return value of f) while f ∘ g results always results in a function.
Why not make one for yourself? ;)
julia> (∘)(f, g) = x -> f(g(x))
∘ (generic function with 1 method)
julia> (sum ∘ rand)(10)
3.397728240035534
Tip: type \circ<tab> to get ∘
I know, but why isn't something like this in core? * did function composition a while ago, but it was removed (beats me why) and hasn't been replaced.
Enough Perl6 has left me with <compose>(.) to get ∘ :-)
Get involved then, Julia isn't exactly the illuminate.