Skip to content

Instantly share code, notes, and snippets.

@UserGalileo
Last active April 14, 2020 17:46
Show Gist options
  • Save UserGalileo/9118fa0841e8cc56b30682c7549f65b4 to your computer and use it in GitHub Desktop.
Save UserGalileo/9118fa0841e8cc56b30682c7549f65b4 to your computer and use it in GitHub Desktop.
Monad Monoid Associativity
// Associativity
const associativity1 = op(op(f,g), h);
const associativity2 = op(f, op(g,h));
// ...are the same, too!
inspect(associativity1('a')); // Identity(a123)
inspect(associativity2('a')); // Identity(a123)
/**
* We can say that:
*
* op(op(f,g), h) EQUALS op(f, op(g,h))
*
* (f ° g) ° h EQUALS f ° (g ° h)
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment