Skip to content

Instantly share code, notes, and snippets.

@bjdixon
Last active August 29, 2015 14:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save bjdixon/0693a21dc793a2cdc357 to your computer and use it in GitHub Desktop.
Combinators in JavaScript (ES6)
// Kestrel
const K = ( x ) => ( y ) => x;
// Identity
const I = ( x ) => x;
// Vireo
const V = ( x ) => ( y ) => ( z ) => z( x )( z );
// Thrush
const T = ( x ) => ( y ) => y( x ), x;
// Why
const Y = ( x ) => ( ( y ) => y( y ) )( ( y ) => ( x( ( z ) => y( y )( z ) ) ) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment