Skip to content

Instantly share code, notes, and snippets.

View stereobooster's full-sized avatar
🇺🇦
stand with Ukraine

stereobooster

🇺🇦
stand with Ukraine
View GitHub Profile
@stereobooster
stereobooster / combinators.js
Created March 3, 2018 20:42 — forked from Avaq/combinators.js
Common combinators in JavaScript
const I = x => x;
const K = x => y => x;
const A = f => x => f(x);
const T = x => f => f(x);
const W = f => x => f(x)(x);
const C = f => y => x => f(x)(y);
const B = f => g => x => f(g(x));
const S = f => g => x => f(x)(g(x));
const P = f => g => x => y => f(g(x))(g(y));
const Y = f => (g => g(g))(g => f(x => g(g)(x)));
import Html exposing (text)
account = 2 / 0
main =
text (
toString
(account + 1)
)
Symbol Symbol Name Meaning / definition Example
and and x ⋅ y
^ caret / circumflex and x ^ y
& ampersand and x & y
+ plus or x + y
reversed caret or x ∨ y
| vertical line or x | y
x' single quote not - negation x'
x bar not - negation x