Live data from Hacker News

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

graphicallinearalgebra.net

61–70 of 79 posts

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

#62
post #12

Earlier quoted context omitted.

I work at Target and we have a weekly class on algebra, category theory and Haskell because people are interested. It's a mix of programmers learning some of the math and mathematicians learning some of the programming :). It's actually a lot more accessible than it seems at first—these ideas are not complex , just abstract. Thinking at a high level of abstraction is very much a skill which requires specific training…

That sounds awesome! Is Haskell (or other fp languages) commonly used at Target?

I don't work there, but my understanding is their supply chain automation/optimization uses Haskell.

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

#63
post #17

For those want a great intro and overview of category theory aimed at programmers, Bartosz Milewski's lecture series on YouTube [0] is worth the time investment. It covers the topics this post discusses and more, but crucially with plenty of context to help understand why any of it matters. 0: http://www.youtube.com/playlist?list=PLbgaMIhjbmEnaH_LTkxLI7...

Was checking to see if anyone has posted this. Am in the middle of the lectures and they are absolutely fantastic.

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

#64
There's interesting table on wikipedia's Category[0] page, listing group-like structures. It is easy to find useful example of Abel group and useful example of Group which is not Abel group (say, string concatenation with negation defined as ab - b = a), but while I clearly understand definition of monoid, I cannot think of any useful example of monoid which is not group.

Can somebody help with examples for the rest of structures? Additionally, it seems I don't really get concept of totality. I get what "total function" is, but what does this column really constraint in the context of different structures? I mean, what is a structure that lacks this "totality" thing?

https://en.wikipedia.org/wiki/Category_(mathematics)

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

#65
post #64

There's interesting table on wikipedia's Category[0] page, listing group-like structures. It is easy to find useful example of Abel group and useful example of Group which is not Abel group (say, string concatenation with negation defined as ab - b = a), but while I clearly understand definition of monoid, I cannot think of any useful example of monoid which is not group. Can somebody help with examples for the rest…

The natural numbers {0, 1, 2, ...} under addition are an example of a monoid which is not a group. Another example is natural numbers under multiplication.

An example which may speak to a programmer more: the set of functions which take a 32-bit int as argument and return a 32-bit int, where the operation is composition of functions. The identity is the identity function. Since not all functions are invertible, this monoid is not a group.

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

#66
post #65
post #64

There's interesting table on wikipedia's Category[0] page, listing group-like structures. It is easy to find useful example of Abel group and useful example of Group which is not Abel group (say, string concatenation with negation defined as ab - b = a), but while I clearly understand definition of monoid, I cannot think of any useful example of monoid which is not group. Can somebody help with examples for the rest…

The natural numbers {0, 1, 2, ...} under addition are an example of a monoid which is not a group. Another example is natural numbers under multiplication. An example which may speak to a programmer more: the set of functions which take a 32-bit int as argument and return a 32-bit int, where the operation is composition of functions. The identity is the identity function. Since not all functions are invertible, this…

Oh, silly me, of course, negation must be defined for every pair of elements. Ok, it's pretty clear about monoids (even though actually it would be better if there was an example, where no "natural" inversion exists at all). But what about everything else in the table? Especially I'm interested in magma which is not a semigroup and groupoid which is not a group.

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

#67

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

Watched 1.25 videos (basically, where he drops philosophy and ought to get into real explanations), and am starting to feel dissatisfaction I always feel when try to learn about this stuff from programmers. What I always expect is mathematics, explained informally for easier understanding. What I get is not mathematics, I can even say he is starting to sound mystical. For instance, he says "bunch of objects". He understands, that "bunch" is a weird term (actually, not a term at all) and it might seem he could use word "set" instead, but he can't. Why he can't? He doesn't really explain, he just starts delving into some weird narratives of "set-theorists everywhere see set-nails, because they have a set-hammer" and "because paradoxes". But if you actually studied set theory (and I guess every programmer does at some point, or at least should to) you know ZFC was basically created to help to get rid of these paradoxes, so it still isn't clear why a "bunch" isn't a "set".

So you go to the Wikipedia and learn there is a word "class" (no more complex than a word "bunch" at all, in my opinion) and there exists simple, very much set-theoretical explanation of what is (or might be in different set-theory systems) a class, and why it might be not a set sometimes.

Then he starts with arrows, and again, from the explanation it isn't immediately obvious why he can't use a word "function" instead (and it is immediately obvious when you read definition of category on Wikipedia — and I got used to the fact Wikipedia isn't the best source by far when trying to learn math).

So, my real complaint is these guys are consciously not using mathematics (because math texts are "scary" — and, yeah, I agree, they often are) when essentially explaining mathematics. Category theory isn't some different discipline, it isn't "superset" of mathematics — it is mathematics. Informal is good when it isn't "imprecise", otherwise it's just useless and harmful. I sometimes think it might be easier to actually get used to (once more all over again) all math-talk and read something like "Categories for a working mathematician", instead of trying to decipher all these "simpler" informal explanations.

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

#68

Earlier quoted context omitted.

could you elaborate on the energy orgasms? I realize you've edited that part out but it was the most interesting for me personally because I had similar experiences after I learned Idris and understood the Curry-Howard isomorphism.

I took it out cause it seemed egregious, but since you're somewhat familiar with the topic, here's a little more to build on: Imagine yourself as a bounded poset if you don't make much money or a bounded proset if you do. By definition, you have both initial and terminal objects, called "bottom" & "top," respectively. For many, this concept may be tricky, as people's heads and asses are often indistinguishable. They'…

Ha! I think I managed to grab both the top and bottom of this post!

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

#69
post #44
post #7

Earlier quoted context omitted.

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 approa…

THANKS! This is great. I watched the first 3 videos in the series and will finish the rest this week. I love his energy and his ability to explain this stuff.

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

#70
post #55
post #12

Earlier quoted context omitted.

I work at Target and we have a weekly class on algebra, category theory and Haskell because people are interested. It's a mix of programmers learning some of the math and mathematicians learning some of the programming :). It's actually a lot more accessible than it seems at first—these ideas are not complex , just abstract. Thinking at a high level of abstraction is very much a skill which requires specific training…

Is this at the HQ in Minneapolis? I hope to move back to MN someday (to raise the younglings) and you make Target sound awesome!

Nah, it's in the south bay. I've been to some meetups there.
Post reply on HN