News for hackers. Stuff that matters.
Re:Serotonin booster leads to increased functional brain con... by xeonmc on Wednesday June 14, 2023 @06:39AM (#36323895)
Oh, that's disappointing. I was hoping for a drug that can finally help me understand how monads are just simply monoids in the category of endofunctors.
Re:Serotonin booster leads to increased functional brain con... by naich on Wednesday June 14, 2023 @07:16AM (#36324152)
Maybe LSD or mushrooms?
Re:Serotonin booster leads to increased functional brain con... by mmiliauskas on Wednesday June 14, 2023 @07:23AM (#36324214)
This guy monoids.
Re:Serotonin booster leads to increased functional brain con... by PartiallyTyped on Wednesday June 14, 2023 @07:31AM (#36324270)
I know that you are memeing, but if are interested in category theory and have exp in functional programming; “category theory” for programmers is possibly a good place to start.
Re:Serotonin booster leads to increased functional brain con... by HKH2 on Wednesday June 14, 2023 @08:24AM (#36324799)
It's probably so simple you assume the most straightforward understanding of it couldn't possibly be right.
Re:Serotonin booster leads to increased functional brain con... by swader999 on Wednesday June 14, 2023 @09:01AM (#36325235)
There is a drug already for that. Catnip.
Re:Serotonin booster leads to increased functional brain con... by LoganDark on Wednesday June 14, 2023 @11:31AM (#36327469)
AIUI, an "endofunctor" is just a function that returns the same type as its input, and a "monoid" is one that has an "identity element" (that isn't part of the arguments). So what that's saying is basically "a monad is a function that takes a single argument and then returns the same type as that argument". Which is not a terrible take, though extremely simplified.

In practice monads are "functors", not "functions", which basically means a monad represents the set of possible operations you can perform, which is why objects/structs can be monads (because you call functions on them to perform those operations, i.e. the object you can call those functions on represents the operations that can be performed by those functions).

As a result, monads in practice usually have some collection of fundamental operations that make them useful (looking at Rust's `Option`[0] might be enlightening), like map, join (flatten), etc.

[0]: https://doc.rust-lang.org/stable/std/option/index.html

Re:Serotonin booster leads to increased functional brain con... by amboo7 on Wednesday June 14, 2023 @05:06PM (#36332652)
No, rather in the category of endocrine functors.
Re:Serotonin booster leads to increased functional brain con... by qingcharles on Wednesday June 14, 2023 @06:42PM (#36333843)
I'm also disappointed. I hoped it would help me understand palato-alveolar ejective fricatives and how they differ from voiced retroflex lateral approximants.

Back to the drawing board!