def. “Cat” Category is a category of all (simple) categories.
- simple, because there are logical issues with things like “set of all sets”
def. Functor. let be a functor. Think of it as a map from category to where
- morphism , maps to
- “preserves structure”: then
- “preserves identity”: Intuition. key is it “preserves structure” This is also called ”functoriality”
- ¶It may map multiple objects into one, both maps to
- ¶It may map multiple morphisms in a hom set to single morphism in .

Compositon of Functors
Motivation. Types and methods, in haskell is objects and morphisms in the category of Hash. But it doesn’t stop there; the whole new system of Algebraic Type System is, in fact, functors. In this case:
- Type constructors (e.g.
Maybe a) is a functor - Composition of type constructors (e.g.
Maybe. List a) is functor composition - Type constructors which take two parameters (e.g.
Either a b) is a bifunctor. These concepts will be introduced below.
- Functors can also be composed like morphisms:
Example. consider functors ListandMaybewe discussed above, with their ownfmapfor morphisms:
Then we can consider the composed functor MaybeList functor which composes these two functors together.
Bifunctors
Motivation. Bifunctors are interesting because they are a special type of functor that takes in two arguments. We consider them mainly because we want to talk about binary operations, like in any other abstract algebra topic. def. Bifunctor is a functor of two arguments, i.e. maps two categories into one category.
- the objects you can map as just a cartesian product of two. There’s no restrictions on how you map objects.
- the morphisms have to map in a functorial way (=preserves identity, composition.)