Hacker News new | ask | show | jobs
by epolanski 45 days ago
No there are no trivial details, and you don't need a mathematics major or category theory to understand what a functor is.

It's a pair of a type constructor F(a) and a map operation a -> b to get an F(b).

The two "non-trivial" details are the fact that the map operation has to respect identity, map(id) = id, and function composition: map(g ∘ f) = map(g) ∘ map(f)

None of those concepts is any difficult, nor requires any "math major" or non-trivial details, because the are not there.

2 comments

Most of the stuff you just explained is absent from your explanation of monads. So it turns out monads are not so simple after all for people who don't already understand functors...
When there are 100 explanations of some topic, maybe it's not so trivial, after all, even when the bare axioms seem trivial.