[1] https://ncatlab.org/nlab/show/monoid+in+a+monoidal+category
Monads are monoids in the category of endofunctors
201–210 of 241 posts
Re: Monads are monoids in the category of endofunctors
#202Wait, 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 -…
I'd say reading the Bible, or any other deep philosophical/spiritual text in a translation is almost an utter waste of time (unless that actually helps you psychologically, then it is not), if not harmful.
The original words and phrasing with all their possible meanings make a huge lot more sense than specific translations.
Something that sounds banal or weird can actually mean something entirely different and deep once you carefully analyze the original words.
It is, however, important to remember Latin is not the original for the Bibile. But it still has a lot of what has been lost in many other translations.
Re: Monads are monoids in the category of endofunctors
#203Earlier quoted context omitted.
So you would say the same for programming in general then? Should programmers not use the word "function" because that word is foreign to non-programmers and might push them away?
It's tricky with functional programming. It's like reading SICP, and after a lot of effort, y-combinators and stuff, the outcome is like "See? Thanks to this invention, we can easily pass multiple parameters into a function". Which is fun, but not anything that will impress a non-functional programming user.
Re: Monads are monoids in the category of endofunctors
#204There’s a few gaps in this explanation that my deductive completionist brain is looking for. Namely, I’m wondering what kind of thing is even capable of being a monoid and an endofunctor at the same time. Mathematically, a monoid is a set (or collection to be more general) closed under a binary operator (the monoidal product) and with a distinguished identity element. An endofunctor is a mapping from a category to it…
The categorical definition of a monoid is different than the usual algebraic one (although one can be recovered from the other) and usually treats a monoid as a single object (hence "mono-"). In particular, usually a monoid is defined as a single object category (sometimes a "monoid object" is defined inside a category, but that's a different presentation). The usual multiple objects of an algebraic monoid correspond…
Re: Monads are monoids in the category of endofunctors
#205Earlier quoted context omitted.
Mathematically the main thing stopping it from being a function is that categories are typically too big to be a set. Otherwise they're pretty much the same as a function. The whole type thing is just something Haskell does, it's not something that's meaningful for general categories.
Not really, mathematically a functor is really two "functions," one mapping objects to objects and one mapping morphisms to morphisms, along with some conditions that make sure the functor is "structure preserving." It is fundamentally a type level construct because, as it is applied to programming, the category in question is the category of types (which is not technically a category due to the halting problem but w…
The whole distinction between value-level or type-level is meaningless in general categories. Sure there's a distinction between morphisms between objects and functors between categories but you've also got the category of categories where the morphisms are functors between categories.
Edit: I'll have to concede that the article confuses them too much though, you can't just pick a random function and declare it to be a functor, especially when it's not clear between which categories.
Re: Monads are monoids in the category of endofunctors
#206This post is very wrong. Being a monoid in the category of endofunctors means something very different from being a monoid in the normal sense (they're related in a category-theoretic way, but the similarity is at a very abstract level). Simple sequences have a lot of structure which mean they are a lot of different things; it is true that sequences are all of monads, functors, and monoids, but the latter structure i…
https://twitter.com/randyshoup/status/992773186239516677?lan...
Re: Monads are monoids in the category of endofunctors
#207Re: Monads are monoids in the category of endofunctors
#208E.g. Arrays are monads under concatenation. So why people then say easily "Option type is monad" without stating under which operation? I assume Option is monad under "all" and "any" function, but not sure.
Re: Monads are monoids in the category of endofunctors
#209This post is very wrong. Being a monoid in the category of endofunctors means something very different from being a monoid in the normal sense (they're related in a category-theoretic way, but the similarity is at a very abstract level). Simple sequences have a lot of structure which mean they are a lot of different things; it is true that sequences are all of monads, functors, and monoids, but the latter structure i…
Yet you didn't say how exactly different. I understand I probably need to know category theory for that, yet nevertheless OP's post was useful, fulfilled some curiosity, but your comment didn't, besides leaving feeling "it's complex", sorry.
I'd really appreciate if someone one day wrote as clear explanation of monads as OP's, but at the same time staying correct.
Re: Monads are monoids in the category of endofunctors
#210So we cannot talk about a type being monad without also saying under what function? E.g. Arrays are monads under concatenation. So why people then say easily "Option type is monad" without stating under which operation? I assume Option is monad under "all" and "any" function, but not sure.