Live data from Hacker News

Monads are monoids in the category of endofunctors

sambernheim.com

1–10 of 241 posts

Re: Monads are monoids in the category of endofunctors

#4
post #3

Functional programming is subject to an enormous amount of gatekeeping. Kudos to the author for pushing that gate wide open.

Agree. Too often descriptions of monads assume that the reader has no formal math training whatsoever and do a lot of handwaving, diagrams, examples, etc. without actually providing a useful definition. This post is the exact opposite.

Re: Monads are monoids in the category of endofunctors

#5
Wait, a functor is just a pure unary function? And an endofunctor is just one of those where the argument type and return type are the same? This could have been explained to me years ago, in five minutes?

Sometimes it makes me mad that so much confusion (and as another commenter put it, gatekeeping) has been sown in FP circles through the invention of pointlessly-obfuscated terminology for everything (and through - among many in those circles - a lack of interest in connecting the very simple dots that would allow masses of people to understand these concepts). It's like when the medieval Catholic Church refused to print a bible in anything but Latin so that they'd remain the sole authority on its content.

Kudos to the OP for cutting through some of that, but shame on those who maintain this status quo.

Edit: assuming it really is (roughly) that simple. Some in the comments have suggested parts of the OP were wrong (assuming they aren't just being pedantic), so I'm curious to see discussion.

Re: Monads are monoids in the category of endofunctors

#6
post #3

Functional programming is subject to an enormous amount of gatekeeping. Kudos to the author for pushing that gate wide open.

1. no state

2. no side effects

And you get most of the benefit of FP in a way that everyone can understand and can use any language.

Re: Monads are monoids in the category of endofunctors

#8
post #5

Wait, a functor is just a pure unary function? And an endofunctor is just one of those where the argument type and return type are the same? This could have been explained to me years ago, in five minutes? Sometimes it makes me mad that so much confusion (and as another commenter put it, gatekeeping) has been sown in FP circles through the invention of pointlessly-obfuscated terminology for everything (and through -…

Kind of reminds me of an old saying I heard somewhere, that I'll paraphrase here: "novice writers use little words, intermediate writers use big words, and expert writers use little words."

Like, it's fun to communicate in technical jargon -- and personally I'm quite proud of the vocabulary I have built up over time -- but you are totally correct in that it serves as a gatekeeper for an in-group to retain its dominance over a given field. There is a lot to be said for effective communication using a simple, base language and reserving obtuse technical terms for areas where one needs to be very specific.

There's another point to be made for not inventing new technical terms when existing ones apply. The amount of overlapping terminology in this field is infuriating to me.

This is true across all disciplines...

Re: Monads are monoids in the category of endofunctors

#9
post #5

Wait, a functor is just a pure unary function? And an endofunctor is just one of those where the argument type and return type are the same? This could have been explained to me years ago, in five minutes? Sometimes it makes me mad that so much confusion (and as another commenter put it, gatekeeping) has been sown in FP circles through the invention of pointlessly-obfuscated terminology for everything (and through -…

Honestly most of what I've learned in category theory is just terminology. 2 Dozen flash cards would really take all the mystery away

Re: Monads are monoids in the category of endofunctors

#10
post #5

Wait, a functor is just a pure unary function? And an endofunctor is just one of those where the argument type and return type are the same? This could have been explained to me years ago, in five minutes? Sometimes it makes me mad that so much confusion (and as another commenter put it, gatekeeping) has been sown in FP circles through the invention of pointlessly-obfuscated terminology for everything (and through -…

> Wait, a functor is just a pure unary function? And an endofunctor is just one of those where the argument type and return type are the same?

No. I don't know why the article talks about ordinary functions on values as if they're functors. They're not (or at least, not in a nontrivial way; you could come up with a silly, useless way in which they are, but that's not what anyone's talking about). Sorry, but it's the article that's misleading you here.

Roughly speaking, in the programming context, a functor is a generic type with a map operation. E.g., arrays; you can map a function over an array by applying it to each element.

Since there's only one category in play here, these functors are endofunctors of that category; one doesn't normally say "endofunctor" in this context since it doesn't convey any additional information. (As opposed to "a monad is a monoid in the category of endofunctors", where you want to specify that, because that statement is true beyond just the programming context.)

Post reply on HN