Live data from Hacker News

A monoid is a category, a category is a monad, a monad is a monoid

graphicallinearalgebra.net

41–50 of 79 posts

Re: A monoid is a category, a category is a monad, a monad is a monoid

#41
For anyone wondering how this is useful outside of programming and/or looking for an easier introduction, check out Category Theory for the Sciences [1]. There are free digital versions on Github, too [2]. Here's the reasoning given by the author:

"Information is inherently dynamic; the same ideas can be organized and reorganized in countless ways, and the ability to translate between such organizational structures is becoming increasingly important in the sciences. Category theory offers a unifying framework for information modeling that can facilitate the translation of knowledge between disciplines."

[1] https://mitpress.mit.edu/books/category-theory-sciences

[2] https://github.com/mmai/Category-Theory-for-the-Sciences

Re: A monoid is a category, a category is a monad, a monad is a monoid

#42
post #39

Earlier quoted context omitted.

Learning Haskell, if you just want to hack and build a program, is not really complicated and you don't need a math degree or to be particularly smart. You just need to understand it won't be like writing other languages you learned before. That doesn't make it more difficult, just different.

Good to know. I think I get too into my head when reading about it all. Monads? Monoids? Functors? Oh my! Edit: thank you all for your wonderfully encouraging and useful responses. I know what I'm playing with tonight!!!

I know the current consensus seems to have moved away from this recommendation [1], but have you tried reading the (free online!) book "Learn You a Haskell for Great Good" (http://learnyouahaskell.com/)? It provides an easy to understand and uncomplicated introduction to monads, monoids, functors, and everything you find scary about Haskell. You won't be able to write full-fledged programs with it, but you won't be scared of these concepts anymore.

[1] The problem with "easy to understand" is that it sometimes leads to oversimplified or wrong intuitions, but to be honest I found the book a nice -- if not immediately useful -- introduction to Haskell.

Re: A monoid is a category, a category is a monad, a monad is a monoid

#43
post #42

Earlier quoted context omitted.

Good to know. I think I get too into my head when reading about it all. Monads? Monoids? Functors? Oh my! Edit: thank you all for your wonderfully encouraging and useful responses. I know what I'm playing with tonight!!!

I know the current consensus seems to have moved away from this recommendation [1], but have you tried reading the (free online!) book "Learn You a Haskell for Great Good" ( http://learnyouahaskell.com/ )? It provides an easy to understand and uncomplicated introduction to monads, monoids, functors, and everything you find scary about Haskell. You won't be able to write full-fledged programs with it, but you won't be…

I've found Professor Frisby's Mostly Adequate Guide to Functional Programming to be the best on ramp. He builds up the concepts carefully till you are using applicative functors and it's always very practical and applied.

I will probably now re-read Learn You a Haskell and actually write some Haskell.

[1] https://drboolean.gitbooks.io/mostly-adequate-guide/content/

Re: A monoid is a category, a category is a monad, a monad is a monoid

#44
post #7
post #2

Are there really that many people on NH that can understand this? I'm not trying to be snarky, I'm legitimately interested. It seems like this class of knowledge is highly specialized, yet I see posts like these high up on NH frequently.

I'd be more interested to know whether there's a practical use of understanding it on this level. I wanted to learn about monads and wrote some smaller Java examples using streams and flatmap. You can see the benefit and understand how it's implemented very easily. However, the academic explanations and notations were not helpful and I'd argue made understanding the concept needlessly complicated.

I really find it difficult as well, and I think it is a lot to do with the nomenclature that surrounds the field. Sometimes I feel it's almost kept obtuse on purpose.

The way I think about is to think of it is if "Design Patterns" helped show how to "engineer" software at the medium scale, category theory is a tool for helping us learn how to compose systems, and not just software.

I wish it were a little more approachable, but it seems like we are getting there.

There are people like Bartosz out there who really want to make it second nature.

https://bartoszmilewski.com/2014/11/04/category-the-essence-...

I mean just think, it wasn't that long ago nobody knew what the heck a lambda was ;)

We'll get there...

Re: A monoid is a category, a category is a monad, a monad is a monoid

#45

In most of the category theory posts on HN I've seen, there's at least one person asking ahead this stuff is useful for. This comment is about why I find it useful. Why I learn this stuff: to more effectively change things about myself. Category Theory is an abstract math of relationships. I use it to better understand how my mind and body work. How parts of me are related in the moment and/or across time. Understand…

accidentally stumbled on the Buddhist practice of deity visualization, which created a second conscious voice in my head. She helps me learn how to embody more than one new personality trait at a time easier than if I simply focused on being those things. It's weird/complicated, and I'm willing to go into more detail if people have questions. I would love you to go into more detail, though probably only for all the w…

Standard advice to learning a set of new personality traits: pick one each morning to choose to embody for the day & focus on it.

How I do it: associate the set of traits with an identity somewhat separate from my own. She's essentially a clone of my personality, except she identifies as a woman & embodies the following personality traits: gentleness, patience, valuing relationships based on emotional support available through them, emotional thinking, relational thinking, intuitive. While these traits are considered stereotypical female traits, I don't view them that way. I think the process I went through would've worked the same if I'd chosen to associate those traits with an animal or, as Buddhists do, some kind of humanoid deity.

She develops her own beliefs, behaviors, emotions, and motivations that emerge from her core values. I'm ultimately aware she's simply a part of my brain...a set of neural networks encoding a set of traits...so it's easy for me to adopt her perception as my own.

That's how we learn together. It's a collaborative relationship. We can practice new ways of communicating in my head. It's the difference between having a two-sided conversation aloud where you're using your own voice for both sides versus using a different voice for each side.

It's sometimes easier to hear ourselves when we hear what we're saying coming from someone else.

How was that? Are you not entertained? ;)

Re: A monoid is a category, a category is a monad, a monad is a monoid

#46

In most of the category theory posts on HN I've seen, there's at least one person asking ahead this stuff is useful for. This comment is about why I find it useful. Why I learn this stuff: to more effectively change things about myself. Category Theory is an abstract math of relationships. I use it to better understand how my mind and body work. How parts of me are related in the moment and/or across time. Understand…

Does anyone have constructive criticism to go along with the downvotes?

Hehe....category theory is a constructive math. Playing off the unintentional pun of "constructive criticism," I think it's time to create a platform where downvotes must be accompanied with constructive reasons or face being downvoted themselves.

Re: A monoid is a category, a category is a monad, a monad is a monoid

#47
post #39

Earlier quoted context omitted.

Learning Haskell, if you just want to hack and build a program, is not really complicated and you don't need a math degree or to be particularly smart. You just need to understand it won't be like writing other languages you learned before. That doesn't make it more difficult, just different.

Good to know. I think I get too into my head when reading about it all. Monads? Monoids? Functors? Oh my! Edit: thank you all for your wonderfully encouraging and useful responses. I know what I'm playing with tonight!!!

It's common.

It's often thought that in order to program Haskell one must understand or use Monads since they are so often mentioned. That's often a mental hurdle for those interested in the language.

Two things to keep in mind here are:

-in the book "An introduction to functional programming systems using Haskell" by A. Davie (1992), Monads (or Functors or Monoids) aren't mentioned at all. That's because they hadn't been architected yet. Monads are not an inherent part of Haskell without which you can't learn or use the language.

-Monads are ordinary data types, even if syntactic sugar is provided. They are not a core aspect of the language.

An explanation I found most useful is http://blog.sigfpe.com/2006/08/you-could-have-invented-monad...

One can just start programming Haskell and ignore Monads if one wants. At some point you will design them or something much like them yourself, making their understanding an "Aha!" moment.

Re: A monoid is a category, a category is a monad, a monad is a monoid

#48

I recently started going through Bartoz Milewski's Category Theory lectures [1]. I think they are a very nice place to start learning these things. [1] https://m.youtube.com/watch?v=I8LbkfSSR58

I'll second this. I really enjoy the bits of philosophy he throws in with it, too.

Re: A monoid is a category, a category is a monad, a monad is a monoid

#49

In most of the category theory posts on HN I've seen, there's at least one person asking ahead this stuff is useful for. This comment is about why I find it useful. Why I learn this stuff: to more effectively change things about myself. Category Theory is an abstract math of relationships. I use it to better understand how my mind and body work. How parts of me are related in the moment and/or across time. Understand…

Does anyone have constructive criticism to go along with the downvotes?

The downvote button should be banished is my only constructive criticism.

As far as the rest, I'm largely right there with you. I also use what you call the "second conscious voice" as well, and agree it's extremely helpful if not abused, plus some of the other stuff too.

I used to live in Seattle btw but back in Europe for a while at the moment otherwise would have loved to chat.

You sound to be on a good path. Best.

Re: A monoid is a category, a category is a monad, a monad is a monoid

#50
post #8

For anyone interested to start on this subject, Philip Wadler's Category Theory for the Working Hacker [1] is an excellent introductory lecture for building an intuition. [1] https://www.youtube.com/watch?v=V10hzjgoklA

just to note this talk briefly alludes to another subject, the Curry–Howard isomorphism, something Philip Wadler had similarly given a talk about at Lambda Days (2016) titled 'Propositions as Types'[1] (slides [2] and the video recording[3]).

[1]: http://www.lambdadays.org/lambdadays2016/philip-wadler

[2]: http://www.lambdadays.org/static/upload/media/14562260715188...

[3]: https://youtu.be/aeRVdYN6fE8

Post reply on HN