Tag Info

Arbitrary-length currying

JavaScript (ES6), 18 bytes f=n=>m=>m?f(m+n):n Pass a falsy value to retrieve the sum. Zeros could be allowed for a cost of 2 bytes. Try it online ...
• 172k

How many arguments were passed?

Java (JDK 10), 11 bytes a->a.length Try it online!
• 14.4k

How many arguments were passed?

JavaScript, 15 bytes [].push.bind(0) The Array.prototype.push function takes any number of arguments, adds them to its array, ...
• 3,742

Implement Takewhile

Mathematica, 18 bytes #~TakeWhile~EvenQ& Another glorious built-in that is beaten by a factor of 3 by golfing languages without the built-in...
• 197k

Implement Takewhile

Haskell, 13 bytes fst.span even span splits the input list into a pair of lists just before the first element where the ...
• 35.9k

Church Booleans

Haskell, 50 - 6 = 44 bytes -1 byte thanks to Khuldraeseth na'Barya, and -1 byte thanks to Christian Sievers. ...
• 10.8k

Implement Takewhile

MATL, 6 bytes toYs~) Try it online! Explanation ...
• 105k

• 145k

Arbitrary-length currying

Haskell (GHC), 118 bytes This is 98 bytes for the code and 20 bytes for the GHC compiler flag -XFlexibleInstances, which enables a type system extension. ...
• 42.7k

How many arguments were passed?

JavaScript (ES6), 16 bytes (...a)=>a.length ...
• 34.9k

Arbitrary-length currying

Python 2, 42 41 36 bytes This solution will never have an overflow, since Python supports arbitrary-precision integers. Zero is the "special value". ...
• 23.4k

How many arguments were passed?

Python 3, 15 bytes lambda*a:len(a) Try it online!
• 49.8k
Accepted

How many arguments were passed?

Amstrad CPC Z80 binary call from BASIC, 1 byte, hex encoded C9 : RET (Also 2 and 5 byte versions, see below) Upon entry to the call, the number of ...
• 4,266

Implement Takewhile

Hexagony, 19 2.}<@>%?<{>$"/\M!8; Readable: 2 . } < @ > % ? < { >$ " / \ M ! 8 ; Try it ...
• 17.5k

Arbitrary-length currying

Mathematica, 25 bytes f[x_]@y_=f[x+y] f[x_][]=x Try it online! (Using Mathics.) It's possible to do three bytes less by porting the JavaScript answer, but I ...
• 197k

Arbitrary-length currying

C, 62 58 bytes, borderline competing Saved 4 bytes thanks to Kevin! (Still not removing typedef because it's something needed in order to be called.) ...
• 40.1k
Accepted

Church Booleans

Binary Lambda Calculus, 13.875 12.875 bytes (103 bits) Binary Lambda Calculus Language (BLC) by John Tromp is basically an efficient serialization format for lambda calculus. It is a great fit for ...

Implement a zipwith function

Haskell, 22 bytes (.zip).(.).map.uncurry Try it online! Not particularly interesting, just a reimplementation of zipWith ...
• 361

Make a long type signature

Haskell with extensions, $\ggg A(A(A(A(220,0),0),0),0)$ Z::Z#Z#Z#Z#Z#Z#Z#Z#Z?Z data a?b=Z|S(a?b) type family m#n where Z#n=S n;S m#Z=m#S m;S m#S n=m#(S m#n) Try ...
• 1,167

Are there any functional programming languages designed for code-golfing?

Husk Husk is a pure functional golfing language created by me and Leo and inspired by Haskell. It combines a rigid type system, type inference and extensive overloading. Functions are first class ...
• 42.7k

Find a Fixed Point

APL (Dyalog), 2 bytes ⍣= Try it online! NB: I define O←⍣= in the the input section due to a bug in that derived monadic ...
• 11.6k