In category theory, composition is the joining together of two morphisms to create a new morphism.
Two morphisms f and g are composable if fs arrow ends where gs starts. i.e. f : A \rightarrow B and g : B \rightarrow C would make f and g composable.
Composition is described using the composition operator \circ, pronounced
after. So f composed with g as described above would be written g \circ f, or
g after f when spoken aloud.
This concept is very closely related to composition in functional programming. This is because it's the same concept, where the category in question is the category of types.
- Category Theory
- At the core of category theory is, unsurprisingly, the category. A category is a collection of objects and morphisms, where each object has at least an 'identity morphism'. A morphism is an arrow pointing from one object to another. Objects exist as named points to give the morphisms context. Category theory concerns itself with the composition of morphisms within different categories and the different states that are possible.
- Compose notes
- When building new knowledge, compose small notes together to create new networks of ideas.
- Any graph can be made into a category