# Is there a name in \`Base\` for \`f-\>(x-\>f(x...))\`

**URL:** <https://discourse.julialang.org/t/is-there-a-name-in-base-for-f-x-f-x/7761>\
**Category:** General Usage\
**Tags:** question\
**Created:** [December 14, 2017, 9:50am UTC](https://discourse.julialang.org/t/is-there-a-name-in-base-for-f-x-f-x/7761 "2017-12-14T09:50:09Z")\
**Posts on this page:** 4\
**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:** [December 14, 2017, 9:50am UTC](https://discourse.julialang.org/t/is-there-a-name-in-base-for-f-x-f-x/7761/1 "2017-12-14T09:50:09Z")

</div>

Sometimes I need to transform functions that take multiple arguments into one which takes a tuple. Eg `g` does this below:

```julia
julia> g(f) = x->f(x...)
g (generic function with 1 method)

julia> f(a,b,c) = a + b + c
f (generic function with 1 method)

julia> g(f)((1,2,3))
6

```

I am wondering if `g` already has a name, either in `Base` or a library, or a more compact syntax. I am hesitant to name it and put it in a library 😄

Also, with named tuples approaching, it has a sibling

```julia
h(f) = x->f(; x...)

```

that does the same for named tuples.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [December 14, 2017, 9:55am UTC](https://discourse.julialang.org/t/is-there-a-name-in-base-for-f-x-f-x/7761/2 "2017-12-14T09:55:50Z")

</div>

> [@Tamas\_Papp](#):
>
> Sometimes I need to transform functions that take multiple arguments into one which takes a tuple.

Why not use splatting at the call site instead? `f((1,2,3)...)`

---

<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:** [December 14, 2017, 10:03am UTC](https://discourse.julialang.org/t/is-there-a-name-in-base-for-f-x-f-x/7761/3 "2017-12-14T10:03:10Z")

</div>

I need to use it in a situation where I am given a function, and then need to provide a function as an argument somewher else. When I am controlling the call syntax, your solution of course works, but let’s suppose I don’t.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [December 14, 2017, 10:43am UTC](https://discourse.julialang.org/t/is-there-a-name-in-base-for-f-x-f-x/7761/4 "2017-12-14T10:43:26Z")

</div>

Alright, then a closure seems like it makes sense. Although I would not name it, just send in `x->f(x...)` directly, since that is self documenting. I don’t think this needs to be in either Base or a library since it is one of the uncountable trivial transformation that you can do with a closure.
