Skip to content

Instantly share code, notes, and snippets.

@evaporei
Created September 13, 2019 19:38
Show Gist options
  • Select an option

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

Select an option

Save evaporei/fb8d645bb8e76ab49d1383cd55ede541 to your computer and use it in GitHub Desktop.
Teoria das Categorias - Objetos e Morfismos
class X {}
class Y {}
class Z {}
function f (x: X): Y {
...
}
function g (y: Y): Z {
...
}
function fComposedWithG(x: X): Z {
const y = f(x)
return g(y)
}
// fComposedWithG também pode ser escrito como:
function fComposedWithG(x: X): Z {
return g(f(x))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment