PartialFunctions.:$
— Method($)(f::Function, args...)
Partially apply the given arguments to f. Typically used as infix f $ args
The returned function is of type PartialFunctions.PartialFunction{typeof(f), typeof(args)}
Examples
julia> using PartialFunctions
julia> simonsays = println $ "Simon says: "
println("Simon says: ", ...)
julia> simonsays("Partial function application is cool!")
Simon says: Partial function application is cool!
julia> typeof(simonsays)
PartialFunctions.PartialFunction{typeof(println),Tuple{String}}
PartialFunctions.:<|
— Method<|(f, args)
Applies a function to the succeeding argument or tuple of arguments. Acts as the reverse of |>
, and is especially useful when combined with partial functions for an alternative, low-parenthese function chaining syntax
Examples
julia> using PartialFunctions
julia> isdigit <| '1'
true
julia> (+) <| (2, 3)...
5
julia> map $ Int <| [1.0, 2.0, 3.0]
3-element Array{Int64,1}:
1
2
3