# Is this an acceptable way to shave a byte in ES6?

Say there's a challenge with two inputs. Can we submit a function signature like this?

a=>b=>...


(a,b)=>...


The function then becomes callable as f(a)(b) instead of f(a,b), if we provide example usage. Is this considered acceptable, or should it be added to "standard loopholes"?

• I'm really tempted to say "morally, no", but I don't have any actual argument against it. – Sp3000 Feb 15 '16 at 2:23
• It... feels wrong, but I don't know why. >_> – Doorknob Feb 15 '16 at 2:27
• It should be fine, but don't think you can write actual code like this... ;) – Conor O'Brien Feb 15 '16 at 2:29
• It is only shorter for dyadic functions. – Dennis Feb 15 '16 at 2:31
• We don't have any rules against currying, so I don't see why not – user45941 Feb 15 '16 at 4:10
• Haskell does this all the time, every function has only one argument. So of course it should be allowed for ES6, too. – nimi Feb 15 '16 at 7:07
• I've added a corresponding answer to the list of admissible I/O methods so people don't have to know about yet another meta post. – Martin Ender Feb 15 '16 at 7:49

# Well, yes.

You just have to specify how to call it in your answer. It's no different than a submission that expects a certain type of input input (command line args vs. STDIN, for example).

• As odd as that kind of function definition feels, I think you're right. – Alex A. Feb 15 '16 at 2:26

## No.

This is just shifting work to the caller. Taking that to the nth degree, can't you just submit c=>c() to every challenge, explaining that your function needs you to call it with the argument z=>...insert actual code here...?

I don't see any reason why the conventions of function calling in Haskell should affect the conventions of function calling in Javascript.

# No

My reasoning is that the output is wrong.

If the challenge was:

Take two integers a and b and output the sum of a and b.

a=>b=>a+b

then your answer is in the form of a function (a=>...), but the output of this function is another function instead of "the sum of a and b".
• Does it return a function if you call it like f(a)(b)? – Alex A. Feb 15 '16 at 3:08
• I disagree. If you know lambda calculus, you know that \xy.xy is the same as \x.\y.xy. (If you don't: basically, chaining functions as a=>b=> is the same as (a,b)=>). – Mama Fun Roll Feb 15 '16 at 3:16
• @AlexA. No, it would return the sum when called like f(a)(b), but note that you are actually calling the outer and the inner function which seemed like processing outside of the solution to me. If your answer is the outer function, I feel like you should only be allowed to call the outer function. – user81655 Feb 15 '16 at 3:20
• I think calling it like f(a)(b) is reasonable so long as its stated that it should be called that way. – Alex A. Feb 15 '16 at 3:21