Skip to content

Instantly share code, notes, and snippets.

@evaporei
Last active November 28, 2025 13:46
Show Gist options
  • Select an option

  • Save evaporei/e22187cde0dfad339262531a37a5755f to your computer and use it in GitHub Desktop.

Select an option

Save evaporei/e22187cde0dfad339262531a37a5755f to your computer and use it in GitHub Desktop.
Category Theory - Associativity
class A {}
class B {}
class C {}
class D {}
function f (a: A): B {
...
}
function g (b: B): C {
...
}
function h (c: C): D {
...
}
// h ∘ (g ∘ f) == (h ∘ g) ∘ f == h ∘ g ∘ f
//
// Não importa a ordem dos agrupamentos, no final
// a composição terá o mesmo resultado.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment