# Does Base.splat have an inverse?

**URL:** https://discourse.julialang.org/t/does-base-splat-have-an-inverse/138772
**Category:** General Usage
**Tags:** question, splat
**Created:** [August 12, 2026, 2:39pm UTC](https://discourse.julialang.org/t/does-base-splat-have-an-inverse/138772 "2026-08-12T14:39:09Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [August 12, 2026, 2:39pm UTC](https://discourse.julialang.org/t/does-base-splat-have-an-inverse/138772/1 "2026-08-12T14:39:09Z")

</div>

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

```julia
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.

---

<div class="post-metadata">

### Author: ![mikmoore](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mikmoore/32/31109_2.png) [@mikmoore](https://discourse.julialang.org/u/mikmoore)
#### Post date: [August 12, 2026, 2:42pm UTC](https://discourse.julialang.org/t/does-base-splat-have-an-inverse/138772/2 "2026-08-12T14:42:54Z")

</div>

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

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

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

```

---

<div class="post-metadata">

### Author: ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)
#### Post date: [August 12, 2026, 3:06pm UTC](https://discourse.julialang.org/t/does-base-splat-have-an-inverse/138772/3 "2026-08-12T15:06:57Z")

</div>

`splat` is [actually a struct](https://github.com/JuliaLang/julia/blob/15346901f0039751c5488744f1f62de7d87510a8/base/operators.jl#L1337)! The following should do, and can be done as a PR:

```julia-auto
unsplat(s::Base.Splat) = s.f

```

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [August 12, 2026, 3:49pm UTC](https://discourse.julialang.org/t/does-base-splat-have-an-inverse/138772/4 "2026-08-12T15:49:02Z")

</div>

> [@Sukera](#):
>
> The following should do

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.

---

<div class="post-metadata">

### Author: ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)
#### Post date: [August 12, 2026, 4:04pm UTC](https://discourse.julialang.org/t/does-base-splat-have-an-inverse/138772/5 "2026-08-12T16:04:32Z")

</div>

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](https://stackoverflow.com/questions/15993186/what-does-uncurry-do)

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [August 12, 2026, 4:12pm UTC](https://discourse.julialang.org/t/does-base-splat-have-an-inverse/138772/6 "2026-08-12T16:12:24Z")

</div>

> [@Tamas\_Papp](#):
>
> 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.

One could combine the above two suggestions and define:

```julia-auto
unsplat(f) = f ∘ tuple
unsplat(s::Base.Splat) = s.f

```

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

> <https://github.com/JuliaLang/julia/issues/62710>
>
> As discussed in \[this discourse thread\](https://discourse.julialang.org/t/does-b…ase-splat-have-an-inverse/138772) by @tpapp, it might be nice to have an \`unsplat\` function that is the semantic inverse of \`splat\` (it takes a function of a tuple and turns it into a function of separate arguments).
> 
> Implementation could be as simple as:
> \`\`\`jl
> import Base: Splat, splat
> 
> """
> unsplat(f)
> 
> Given a function \`f(t)\` that takes a single tuple \`t\` of parameters, return a function \`g = unsplat(f)\`
> that behaves similar to \`g(args...) = f(args)\`; that is, \`unsplat(f)\` accepts
> the arguments as separate parameters and bundles them together into a tuple for \`f\`. 
> 
> This function is the inverse of \[\`splat\`\](@ref).
> """
> unsplat(f) = f ∘ tuple
> 
> \# make splat and unsplat literal inverses of one another
> unsplat(s::Splat) = s.f
> splat(f::ComposedFunction{\<:Any,typeof(tuple)}) = f.outer
> \`\`\`
