Hacker News new | ask | show | jobs
by naillo 1452 days ago
"A homomorphism is just a structure preserving map. In fact, a functor is just a homomorphism between categories as it preserves the original category's structure under the mapping."

Oh ok. Plain english.

4 comments

Maybe if I explain what a Monad is in Plain English it'll help you understand functors?

A monad is just a monoid in the category of endofunctors.

The closest I've come to understanding Monads was funny enough, the Wikipedia page (ok so there's at least two pages on Wikipedia for Monads, one in a category theory context, and one in a more general programming context, the latter I could actually begin to grasp). It wasn't overly full of vocabulary from category theory, nor did it try to compare it to taco bell menu items.
If I may also quote!

A monad is a special kind of a functor. A functor F takes each type T and maps it to a new type FT. A burrito is like a functor: it takes a type, like meat or beans, and turns it into a new type, like beef burrito or bean burrito.

I think you need to explain endofunctors.

An endofunctor is the category containing monoids such as the monad.*

*This is probably wrong. Please don't explain.

So in all seriousness a functor is a mapping from one category to another, and an endofunctor is a mapping from one category to the same category.
Best comment in this thread. The guide does a so-so job of building on terms previously defined. The term accumulator, for example, is not defined before use. The first appearance of it is under Catamorphism, where the guide says, "A reduceRight function that applies a function against an accumulator and each value of the array (from right-to-left) to reduce it to a single value."

I note, in passing, that the actual guide is just titled "Functional Programming Jargon". It does not claim to be "in plain English".

約束は守られた
Well, it's not nested.