3 ms·
It's perhaps more obvious when you also study groups, rings, and fields, and then you've got an entire zoo of things with direct sums, direct products, homomorp
by ndriscoll 3y ago
It's perhaps more obvious when you also study groups, rings, and fields, and then you've got an entire zoo of things with direct sums, direct products, homomorphosms (the structure-preserving maps), quotients, kernels, images, etc. along with basically the same theorems repeated (the isomorphism theorems). You also have things like free groups and free abelian groups and free rings and maybe you saw a definition of free for vector spaces, followed by a proof that all vector spaces are free, so who cares?
So one thing you get is a unifying theory that tells you what things like "free" or "product" or "sum/coproduct" ought to mean.
Another thing you get is a vocabulary to connect different areas of math. So in topology, you have a space, and then you can associate each point to a group, and then it turns out continuous maps between spaces correspond to group homomorphisms. Or in differential geometry, you have spaces called manifolds which have a vector space at each point (the tangent space), and the derivative turns smooth manifold maps into linear maps of those tangent spaces. So you have ways to associate one type of thing to another type of thing, where their structural maps also get transformed.
Now you can start asking questions like "is the fundamental group of a product topological space a product group?" or "does the derivative send a product manifold to a product vector space?" etc. and try to understand when these "type level maps" (functors) preserve things like decompositions you have for different types.
All of this can give you a more compressed vocabulary for complicated things you might already know, which can make them easier to remember/rederive. It also gives you a new set of interesting questions to ask when approaching new topics.
Edit: for programming purposes, functors are a specific flavor of generic type (generic types are a sort of type level map. e.g. List turns the Int type into the List[Int] type), and maps of functors ("natural transformations", of course functors are something we can study with their own structure maps!) are generic functions. e.g. List and Option are functors, and `head: List[A] -> Option[A]` is a natural transformation. This assumes no exceptions or runtime reflection shenanigans. You also have sums/products/exponentials (algebraic data types), and you have facts about types that look like facts you learned in middle school like A^(B+C) = A^B*A^C, which says the way you define a function from a sum type is by pattern matching (i.e. provide a product over the cases). Neat, I guess. There's also infinite series for recursive types and other silliness, and if you pretend you're working with numbers and solve it like in calculus, you actually get something reasonable. Spooky.