Does Base.splat have an inverse?

Is there a function that inverts splat, in Base, the standard libraries, or a package? As in

f((x, y)) = x + y               # function takes tuples
g(xs...) = f(xs)                # let's unsplat manually
unsplat(f) = (xs...,) -> f(xs)  # unsplat with a closure

Note that I am not asking about implementing this, just whether there is a named implementation somewhere.

I don’t know of one with the same format as splat, but f ∘ tuple or Base.Fix2(∘, tuple) will achieve this:

julia> (sort ∘ tuple)(4,3,1,2)
(1, 2, 3, 4)

julia> Base.Fix2(∘, tuple)(sort)(4,3,1,2)
(1, 2, 3, 4)

splat is actually a struct! The following should do, and can be done as a PR:

unsplat(s::Base.Splat) = s.f

Just to clarify: I meant a semantic inverse, not undoing something that was created by splat. Ie it should work on generic f(::Tuple) functions, as in the MWE.

Ah, I missed that detail. I believe what you’re asking for is the iterated form of uncurry, but in Julia this doesn’t really make sense without knowing what it is that you’re uncurrying. I don’t think that we generally have this in the ecosystem or in Base, since we don’t have arrow types. See also

https://stackoverflow.com/questions/15993186/what-does-uncurry-do

One could combine the above two suggestions and define:

unsplat(f) = f ∘ tuple
unsplat(s::Base.Splat) = s.f

(which could arguably go in Base as a PR).