[Question]
  [
I don't like curry. Help me reverse the effects of this evil question - [Make me some curry](https://codegolf.stackexchange.com/q/162231/95792) - by uncurrying functions.
# Task
* Given a [blackbox](https://codegolf.meta.stackexchange.com/a/13706/95792) curried function, output its uncurried equivalent.
* The curried function will take a single argument and output either another curried function or a value of another type.
* The uncurried function you create will take the same number of arguments as the curried function, but all at once.
# Rules
* In languages without first-class functions, you can use an object with a method in place of a curried function - but please specify this.
* The curried function may also output a function pointer instead.
* If your language does not allow function pointers or makes passing around functions hard to work with, but allows evaluating strings to make functions (e.g. APL), you can use strings to represent both curried functions and your uncurried output function.
* You can also take the number of arguments of the functions as an input to help you determine the depth of currying.
* You may choose to return a function that takes a tuple, list, or other single value containing all the arguments.
* You may constrain the arguments **and return type** to a data type of your choosing, but that type should have more than 1 possible value.
* If `f` is the inputted curried function and `g` is your uncurried function, `f(a1)(a2)...(aN)` must always equal `g(a1, a2, ..., aN)`.
* The order of arguments in the uncurried function should be the same as in the original curried function.
For example, given the function `a -> b -> c -> a + b + c`, you can return a function that looks like `(a, b, c) -> a + b + c` or `arr -> arr[0] + arr[1] + arr[2] -> ...` but not `(c, b, a) -> ...` (wrong order). If you also take the number of arguments of the function as input, then `(a, b) -> c -> ...` would be an acceptable output given the input 2 (2 arguments are curried).
# Bounty
Since Rust is the language of the month, I will be offering a 50 rep bounty on Rust answer to this question if you haven't used Rust before.
  
[Answer]
# [Haskell](https://www.haskell.org/), ~~129~~ 127 bytes, thanks to Wheat Wizard
```
{-#Language GADTs#-}
data N c u o where Z::N o()o;S::N c u o->N(i->c)(i,u)o
(!)::N c u o->c->u->o
(Z!o)_=o
(S n!g)(i,u)=n!g i$u
```
[Try it online!](https://tio.run/##hY9Ra4MwFIXf/RXHtpSELvsBDoVBoS/FPtgnX0aqqYbZXNGEMsZ@u4tuFKEduw/hcO853yG17N9V0wzDp1jupamcrBR2r9tjvxRfgb601FlspZXPx49WyVOjIAROnTYVbK1g/fZwxtmZwmoycL0qoQ0u0j/aWEJfUKuC0iOQooAD4VqrTiGPohTEOL1ko5pOIkmZFknBmX5ynAIW8tmtEIkTid/mIfG32IsMJqx@zLFX0Cs3TNUxSgrgp3U2s93eYIWFIYvZRBEW2GzQ13QF@/2J9/C7YIYcIW7xh0F2M/F7AFuv@X/No@dR9Qjmnjwx/qqemzgfvgE) An unobfuscated version looks like this:
```
{-# Language GADTs #-}
data Natural curried uncurriedArguments output where
    Zero :: Natural output () output
    Successor ::
        Natural curried uncurriedArguments output ->
        Natural (input -> curried) (input, uncurriedArguments) output
deepUncurry ::
    Natural curried uncurriedArguments output ->
    curried ->
    uncurriedArguments -> output
deepUncurry Zero output () = output
deepUncurry (Successor n) g (input, uncurriedArguments)
    = deepUncurry n (g input) uncurriedArguments
```
The caller must specify the number of arguments they want uncurried as a natural number, where `Z` represents 0 and `S` adds one to a number. For example, to uncurry two arguments, you would use `S (S Z)`:
```
> :t S (S Z) ! (+)
S (S Z) ! (+) :: Num o => (o, (o, ())) -> o
```
[Answer]
# [Python 3](https://docs.python.org/3/), 46 bytes
```
lambda g,i:lambda*l,g=g:eval(f'g{"(%a)"*i%l}')
```
[Try it online!](https://tio.run/##K6gsycjPM/6fZhvzPycxNyklUSFdJ9MKwtTK0Um3TbdKLUvM0UhTT69W0lBN1FTSylTNqVXX/F9QlJlXopGmAdWWCNWkkARjJFslaidpJ@soGGtqGOooGIEYmv8B "Python 3 – Try It Online")
# [Python 3](https://docs.python.org/3/), 48 bytes
```
f=lambda g:lambda x,*a:f(g(x))(*a)if a else g(x)
```
[Try it online!](https://tio.run/##NYsxDoAgDAC/0rEVFnUj8TEFKZooEmXA12NMYLtc7tKbtyvOtcpy8GlXhmAaFD2wEQxYiHBg2gUY/PF4@FVN9x4zCraa@2Y7OMPKKkc4apg0zET1Aw "Python 3 – Try It Online")
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 34 bytes
```
g=>(...a)=>a.reduce((h,x)=>h(x),g)
```
[Try it online!](https://tio.run/##DcpLDkAwEADQvVNYzlCzwUqmd5mOaomo@MXty/Ilb5FHTj3m/Wq2NPo8cQ5sgYgE2QodfrzVA0Tz/o7wogmYI08gbB1b/VPtKsWh0LSdafW0pgARWlN2puwR8wc "JavaScript (Node.js) – Try It Online")
-1 byte, thanks to ASCII-only.
---
# [JavaScript (Node.js)](https://nodejs.org), 31 bytes
```
g=>(...a)=>(a.map(x=>g=g(x)),g)
```
[Try it online!](https://tio.run/##DcVBEkAwDADAu1c4JlQuOJnkL1EEgxo1xu/LXnbVR6O/lvOujjCMaeJkLEBEiv9Ku57wshgbvIjOMM08gbL0LJ5Fy77w2GU@HDFsI23BYIba5Y3LW8T0AQ "JavaScript (Node.js) – Try It Online")
This 31 byte version, the returned function is not reusable. I'm not sure if this is allowed in this question...
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 19 bytes
```
Fold[#@#2&]~Curry~2
```
[Try it online!](https://tio.run/##nY47C4MwFIV3/0bA6QptUseWlFKnDg5u4QqptRjqMyZDEf3rVvuSrp3u4Rw@7ldIk6WFNCqRo92OQZVfBOGEujgcrNb3gY6hVqURxNtZQZAfk6zikbylYp/XmTynRiAQiuhyzjune1IizG0LDIH18KlOqjXQ@UCBwRo2PYI/j4EtE6OqUtTwjc0SNdRxE2uPaV67iDiBf0B00YhUkbbg/6i9OvY2oi6s5nudfjn9@AA "Wolfram Language (Mathematica) – Try It Online")
Returns a function of a list of arguments, i.e. `u[f][{a,b,...}]=f[a][b]...`.
Ironically, a short uncurrying involves `Curry`. Then again, functions curried with Mathematica's [`Curry`](https://reference.wolfram.com/language/ref/Curry.html) built-in can accept arguments in uncurried form - per the docs, "the structure of brackets is not relevant, only the number of arguments."
---
To accept a sequence of arguments, i.e. `u[f][a,b,...]=f[a][b]...`, **20 bytes**:
```
f#@#2&~Fold~f?##&
```
[Try it online!](https://tio.run/##nY5LCsIwGIT3XiOQ1V/QxC7ViNiVCxfdhV@ItaXBvkyThZR6CG/gCT1CVHzh1tUMMwzzlcrmaamsTpR3E59dzxciCKOnqC52p2xGCPVroysrSTB1kqAQyySvRaz2qZwXTa62qZUIhCFSIUQ36BbOmKNcF64FjsB7eEcr3VroQmDAYQTjHiF8lJGrEqvrSjbwsYevNdBsDhsTcCMaioj34R8j9sWIdZm2EP6gPTP@ImIUhg/N7l@D3t8A "Wolfram Language (Mathematica) – Try It Online")
[Answer]
# [Underload](https://github.com/catseye/stringie), 11 bytes
```
((^)~^~a~*)
```
[Try it online!](https://tio.run/##K81LSS3KyU9M@a@RqKEFRJogyKVRoVkXp1EJIqqAhEKwgoaCZvB/DY04IK8usU5LE0V9nYaVlZYWSKEVRCUXSBtIP9ggmHYA "Underload – Try It Online")
Function submission (because Underload full programs can't take input).
The TIO link shows a curried function `a(*a(*)*)*` that concatenates its three arguments in reverse order (calling it three times by using the `(argument)~^` function call syntax that calls a function with one literal argument). Then it uses the program above, calling it with arguments 3 (`(::**)`) and the same curried function, producing the output `(a(*a(*)*)*)^^^`. The final line runs this input on the same three literal arguments (`(arg3)~(arg2)~(arg1)~^`), demonstrating that it produces the same result.
## Explanation
```
((^)~^~a~*)
(         )   define function literal:
    ~^          call {argument 1} with argument
 (^)              lambda f, x: f(x)
                {replacing argument 1 with the return value}
      ~ ~       replace argument 2 with
       a          uneval(argument 2)
         *      compose argument 1 and argument 2
                  {and return the function newly created}
```
The basic idea here is to exploit the fact that Underload is generally very polymorphic with respect to how many arguments a function takes. In particular, we can take a function which takes two arguments and produces one return value, and call it in a loop in order to create a function that takes more than two arguments; each iteration will steal an additional argument from the argument stack.
Numbers in Underload are basically curried loops with a specific number of iterations; you can think of the number 3 as having an effect similar to `lambda f: lambda x: f(f(f(x)))` (except with the number of arguments being more flexible than this). So by executing the first argument on `lambda f, x: f(x)`, we effectively end up creating a loop that uncurries a function via simply just calling it repeatedly, consuming an extra argument each time.
This could have been just 8 bytes if not for an off-by-one error: if a function takes 1 argument, it's the same curried and uncurried; if it takes 2 arguments, we have to call it one more time; if it takes 3 arguments, we have to call it twice more, etc.. Arithmetic (other than multiplication and exponentiation) is very verbose in Underload, so instead of fixing the off-by-one error with subtraction, we uneval the function we're uncurrying. The uneval'ed function will consume no arguments and output the original function, so this neatly cancels out one level of uncurrying and thus fixes the off-by-one error.
[Answer]
# [R](https://www.r-project.org/), ~~68~~ ~~67~~ 71 bytes
*Edit: -1 byte thanks to Giuseppe, but then +4 bytes to fix a bug spotted by ASCII-only*
```
function(f)function(...,g=f)el(rev(sapply(c(...),function(a)g<<-g(a))))
```
[Try it online!](https://tio.run/##dZDdCoMwDIWv7VMUvElmJ6i7En2WUWv9YbJJNzdk@OxdtZ3KYIXQfMnhJK3Sw1UMSo25rkz2aG9XqHBNwzBkdV6h7EDJJ9x533cjiLmObFVxrLPsWJvbHO1TTmfLVpb0K1kKY8Xoq5FKOjJ6KBAEQok0p8CDAg8gghKJFeS7CW/irVTMtKFYcOPSsrc3NDiRJSYyEZ@KRopL6uZAhBAjJAgnJKbpvsStmRLL5j1nt5cTgEXc/H6VELGYJczY/u/oDw "R – Try It Online")
This is a horrible bit of [R](https://www.r-project.org/) code, but my attempts using `for` or `while` have so far failed.
Creates a function that uses `sapply` to loop over all its arguments, updating the passed function `f` in each iteration using the `<<-` assignment operator to assign in the 'parent' scope. This generates a list of all the intermediate values (all except the last one are partially-uncurried versions of `f`), so we `rev`erse it and return the new first element (so, effectively the last element), which is the result of the fully uncurried function call.
```
uncurry=                        # define 'uncurry' as
function(f)                     # a function taking argument f, a curried function,
    function(...){              # that returns an anonymous function  
                                # with an undefined number of arguments, denoted as '...'.
        x=                      # define x as 
            sapply(             # the results of applying a function (see below) to each element of
                c(...),         # the concatenation of all the elements of '...' (so: the arguments)
                function(a)     # this is the function to apply, taking argument 'a' as each element:
                    f<<-f(a))   # the value of f(a)
                                # while updating 'f' to this value, in the parent scope
                                # (so the next iteration will use this new version of 'f')
        rev(x)[[1]]             # now, output the last element of x
                                # (which is the value final, uncurried output;
                                # the earlier elements of x are all the partially-uncurried 
                                # versions of f)
    }
```
Note that since we use `c()` to concatenate the argument list `...` into a vector (rather than into a list), the arguments are constrained to be all of the same type (as allowed by the challenge rules). For a more-general version that can accept argments of different types, exchange `c` for `list` (at the cost of an [extra 3 bytes](https://tio.run/##XZDRbsMgDEWfy1egVJpwxTIt2lPbfElVTYRAi9qyCMiWaMq3Zw5hybQHsI@5urZxY2tl61xfjhqzYD4s07CkeZ6DU5/Mi6a59@xufIg1vigE6OPxWWMEOJ1ez@dxSwWdLI2q6a8sFnpNv0y40ofp8MkHZ@yFPlHbPpQzkgp3wcwGT2Zx@afHN9ksVE20ooy4cj3zpiuLXXXo8a4jN8IHxbCrUw0TvHspgCeSvEeCSTaQeAYykC2VVyVv@zQOy0QGrACWVRjfgKAg/V3abk9mxsXf0wpJwGaE1fO/cnLnBUdvjtbjDw)).
---
# [R](https://www.r-project.org/), ~~65~~ 61 bytes
*Edit: -5 bytes thanks to Giuseppe*
```
g=function(f)function(a,...)`if`(nargs()>1,g(f(a))(...),f(a))
```
[Try it online!](https://tio.run/##dZDRCoMgGIWv8ymEbs6/JKh2NWivssyyYtDALUaMnt1ZuRqDXQjn8z8ejxo79GowZsxtk2unH92th6ZNShHHMRWdLtBL09xB50Q00JBEmEdikTbkks9BXV3xz@FlY9SCP9va1J6cGyVBESriOYeMSjpARRWx1bDXkPRiwUblTDuqBXeuVg6@Ax1ObFkTm1jIVVur68nfg4SQEjLCkZgb@o/wNU9sZfeei@/lDViR9rxfJxKRiky42L8T@wY "R – Try It Online")
Alternative recursive version: shorter, easier to understand, and without horrible scoping hacks. Heavily based on comment by ASCII-only, and made nicer (as well as even shorter) by Giuseppe.
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 42 bytes
```
f=g=>(x,...a)=>a.length?f(g(x))(...a):g(x)
```
[Try it online!](https://tio.run/##HctNDkAwEEDhq1jORM0GGzJ1llFtkaYVRNy@fnYvX/JWueQw@7KdVUyTzdmxZw23IiJB1kLBRn/OgwMPNyL83n2dTYpHCpZC8uBAWI@szbuUY2kQalU0qmgR@/wA "JavaScript (Node.js) – Try It Online") Resulting function assumes that you give it the correct number of arguments.
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~27~~ ~~25~~ 24 bytes
-3 bytes thanks to [vrintle](https://codegolf.stackexchange.com/users/83605/vrintle)
```
->f{->a{a.inject f,:[]}}
```
[Try it online!](https://tio.run/##bYq7CoQwEEV7vyKlWRPBR6UkPzJMkcQNaBFEnEJCvj0723vhwH1d5J9Kpmobs7Yuu35PxzfcIqoFsJQaKZn/oK1nArPl1nVeftrQbbKwmlPwCwaEEWFCmHFtKAVDwDX7U3ACGNSoJjXjW1N/ "Ruby – Try It Online")
[Answer]
# [R](https://www.r-project.org/), ~~60~~ ~~58~~ 51 bytes
-2 bytes thanks to [Dominic van Essen](https://codegolf.stackexchange.com/users/95126/dominic-van-essen). Nicer form thanks to [Giuseppe](https://codegolf.stackexchange.com/users/67312/giuseppe)
```
function(f)function(a)Reduce(function(f,a)f(a),a,f)
```
[Try it online!](https://tio.run/##fY9NCsMgEIXX8RRCNjONm/ysArlEL1DMqDQUUpBKKSVntybaGLroQpjvzfPNjPVu8MbN9JjuMxjcS4lnrRxpyE0h0QRdSGHQl1xyctZOWvGvZRNeRvDnVVudKPyAEYEQFPKBg6xGPAFVClk0DIeZb1bsNK6UkTbMrCIXx8CAC9vewhZWcrpquvVpDtQIDUKL0CELzRC06mnNnkUO91zSXg5igTnp1wMEtWhEKzrE/03/AQ "R – Try It Online")
[Answer]
# [Common Lisp](http://www.clisp.org/), ~~54~~ 48 bytes
```
(lambda(f)(lambda(a)(reduce'funcall(cons f a))))
```
[Try it online!](https://tio.run/##lY5NCoMwEIX3nuIhFGfqSu0FepQxMVCI2hqz9eoxqVrctNDZzAfzfkbZh3sGct38gg9kpW@1kOGDhGnqtFddYfygxFpS4@BgIBwncLZZ4/Hk2Kll7AhSJ9aRr6ASgiQpoaB5m4zMOPUyo5iRL/flkoOO4i87daNi1IyGcePjpXj9eOGT6mf8W19QhRpNSvlLG1Y "Common Lisp – Try It Online")
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 14 [bytes](https://codegolf.meta.stackexchange.com/a/9429/43319 "When can APL characters be counted as 1 byte each?") ([SBCS](https://github.com/abrudz/SBCS ".dyalog files using a single byte character set"))
Anonymous tacit prefix function taking the name of a Curried function as right argument, and returning the source of the un-Curried function.
```
⎕NR⊃⍨4-2⍳⍨183⌶
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///qG9qsKteqLOvi/qjtglJ@RUK@Xnqj7oWp@YlJuWkBjv6hAA5QEXOkerFiTkl6iANfkGPupof9a4w0TV61LsZyDC0MH7Us@1/GtCER719YMk1j3q3HFpv/KhtIsiGIGcgGeLhGfw/HajG9FHHjOpHvbu0H/VureVKU09X58oACmtoP@rZf3j7o85FmkAFhkCJDHWuRx3tCkVAyQqFkKLEFLc8hUouBbCAkXbF4emG2pUgFVyZQAETI6AuiCKg1kx1AA "APL (Dyalog Unicode) – Try It Online")
For example, with the function `f ← (~,∩)∘' '`, which consists of the function `~,∩` with a space character as curried right-argument, passing the name `"f"` gives:
`183⌶` explain representation; a structure identical to the structure of the target function, but with integers indicating the name class of the components  
 `[[3,3,3],4,2]` (3 is function, 4 is higher-order function, 2 is array)
`2⍳⍨` index of `2`  
 `3`
`4-` subtract that from 4  
 `1`
…`⊃⍨` use that index to pick from:
 `⎕NR` the Nested Representation, `["~,∩","∘"," "]`
This picks out our result, `"~,∩"`.
[Answer]
# [Attache](https://github.com/ConorOBrien-Foxx/Attache), 11 bytes
```
Fold&:`!##V
```
[Try it online!](https://tio.run/##SywpSUzOSP2fpmBlq/DfLT8nRc0qQVFZOex/cmlRUWVIanEJSCa6IlZB106hWiG6EsqoUNBWMFLQUqhUqFWo5eIKKMrMK4mG64k2jo02jY1VgAJ7ewVDY5iiNIQyHQVjHQWYOqCixJzifKDK/wA "Attache – Try It Online")
Anonymous function that takes input like `f[curried, a1, a2, ..., aN]`.
## Explanation
With some more whitespace:
```
(Fold&:`!) ## V
```
`V` is a function that converts its arguments into a list. `V[1, 2, 3]` yields `[1, 2, 3]`. `Fold` is given the execute operation `!` as a function (``!`) for its first argument, via `f&:n`. `##` composes these two functions.
[Answer]
# [Java (JDK)](http://jdk.java.net/), 81 bytes
(-9 bytes thanks to user. -2 bytes after removing curly braces from for loop.)
```
f->a->{var g=f;for(int i:a)g=((java.util.function.Function)g).apply(i);return g;}
```
[Try it online!](https://tio.run/##jZCxboQwDIbn4yk8kh4gtd1KQepSqUPV4bqdbjAQ0tAQUDCcEOLZabiGtkOH8@DEvyz7@13hgGFVfC6ybhtDUNk66kmqqOx1TrLR0U3sebnCroNXlBomD2x0hCRzeHZNj29ZxXMKfgWp6XgK4FtPU7B6b8wIyVKGKYbpNKABkZRx2RjfNoN8QCYS3/@HYBvKBIuwbdXoSxYbTr3RIOJ52VnCXdtnyhI5sKGRBdSW1z@QkVocT5fqyYiOAX2Y5tzB@/pgprjztMWPhxdNXHATXKW4T2q9YlFAAghhCtma8jUh7G21h9zC/t12GDviddT0FLWWlJT23a2cVztts635GS6HnW4DuAvgfmYs9nazNy9f "Java (JDK) – Try It Online")
Accepts an arbitrary depth `Function<Integer, ?>` where `?` is either `Integer` or `Function<Integer, ?>`, and returns a `Function<int[], Object>`.
I can't really find rules on Java submissions. I tried to mostly follow the format for what counts as the header and what the code body has to look like from an answer on the [inspiration](https://codegolf.stackexchange.com/questions/162231/make-me-some-curry) for this question. Let me know if I got anything wrong
[Answer]
# [R](https://www.r-project.org/), 56 bytes
```
g=function(f)function(a,...)`if`(nargs(),g(f(a))(...),f)
```
[Try it online!](https://tio.run/##dZDNCoMwEITP5ikCXmZqEPpzEnyWNkZjpWAhrZRSfHYbNdVS6CGwX2Z2dhM3dK3pnHvmQ51bX9@bawvLpdQqTVOeGntCq119A1UNC01iFJTlEEstx4ymKuWnb7p4WiUf58pVgXwXCsIQJWUuoZOCG5ikpJgN6waaLxEtVIy0oplw5XLm6DvQYy@m04texNKcK3PJwhxsiR2xJw4UXgx/ENbMxMz@PcewVzBgRq55v05s1U7tlY/9qwxv "R – Try It Online")
Credit to [Dominic van Essen](https://codegolf.stackexchange.com/users/95126/dominic-van-essen) and [ASCII-only](https://codegolf.stackexchange.com/a/216960/67312) for a decent part of this, so please upvote their submissions as well.
The `...` aka [dots](https://stat.ethz.ch/R-manual/R-devel/library/base/html/dots.html) is a special R construct for functions with arbitrary number of inputs.
[Answer]
# [Julia](http://julialang.org/), 22 bytes
```
!f=x->foldl(map,[f;x])
```
`g = !f` will expect an array
[Try it online!](https://tio.run/##yyrNyUw0rPj/XzHNtkLXLi0/JyVHIzexQCc6zboiVvN/moKtAlC8UteuStdOoULb0KASiA2quNKBEoppXFwOxRn55QppGoaaGkaaGsaaUIF0jWhDHSMd41hNrv8A "Julia 1.0 – Try It Online")
[Answer]
# [PHP](https://php.net/), 84 bytes
```
function u($f){return function($a,...$b)use($f){return$b?u($f($a))(...$b):$f($a);};}
```
[Try it online!](https://tio.run/##jY5BCoMwEEX3nkIk4EwNAbUr0@JFuqlWqZs0pMmqeHY7g1oLdlECIZn3/mfs3U6n2tLdB9P64WHiAKLHl@t8cCZepyCuUiklGgzP7ksQTc0@YUSYhWr@6lGPWyk9eLivXQp/oXZBkqQ9vW1UkroKNMnIP1A8I4e34BMJCp4DpFSQoo6sG4wH3ipHKBBKhCOq5GKSD@QE5LKQpfwHTW8 "PHP – Try It Online")
[Answer]
# [Perl 5](https://www.perl.org/), 54 bytes
```
sub f($n,$g){--$n?sub($p,@p){&{f($n,&$g($p))}(@p)}:$g}
```
[Try it online!](https://tio.run/##XY1BCsIwEEX3niLIEDKYYEW6sRR7AW8gSFvatKBpaNqFhFzdOLag4GKG@f8//thmvKcxurlirQAjQaNXCsyZHAFWFhY990vEQZODGASZ4QQ6ROhy4vzjyQSUmBe3jH119afrVUOpoNpDHULINnbszcQ4feDQiUOSUHm6LGRyezXbH9KKo4SOIqIkSz@DKxJfg536wbioLm1TTvPY7FyvzXK5Nw "Perl 5 – Try It Online")
Parameter `$n` is the number of arguments to uncurry, `$g` is the input function which has to be uncurried.
[Answer]
# [C++ (gcc)](https://gcc.gnu.org/), 189 bytes
```
#define T template
T<class F>struct U{F f;auto operator()(){return f;}T<class A,class...B>auto operator()(A a,B...b){return U<decltype(f(a))>{f(a)}(b...);}};T<class F>U<F>u(F f){return{f};}
```
[Try it online!](https://tio.run/##fY5BasMwEEX3OsVAFpFa15RkF6mGZOETxKu0FFmWi8CWjTxaFKOzu3IaN3UXBcGg/98MT/X904dS07SpdG2shjOgbvtGoiZnoRo5DJBnAzqvEIoxh5pLjx10vXYSO0cZZaPT6J2NVVhWjsl1pml6yv7yR5DJKTblz2IhKq0a/Ow1ralkLBvnEWgZKcZD4HeTQuSZp1FjWR7rwMO0MVY1vtIgTBdltWwzQoxFaKWxlMFIAK4eyjtndPVeW3iByxudGRl7uKlc5HdW/srk4@6h5BDmt9zxdnXJ0/uXzdCA1eGgOo8gxAqmuwT2bE63r3b7P7pPYLdCb0LPnAQyfQE "C++ (gcc) – Try It Online")
Function `u` takes in a curried callable object, and returns another callable object which is uncurried.
(I don't see any allowance for a restriction on the return type of the curried function, just on the argument types. If it were allowed, we could save two bytes by replacing both instances of `auto` with `int`.)
]