Hacker News new | ask | show | jobs
by a57721 42 days ago
I majored in mathematics and I learned category theory before touching any serious Haskell, and I still found most of the "monad tutorials" kind of opaque and handwavy, and I think there are inherently non-trivial details unrelated to the notion of functor etc.
1 comments

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.

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.