Live data from Hacker News

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

graphicallinearalgebra.net

71–79 of 79 posts

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

#71
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.

It's specialized but also very general (abstract) without contradiction. I'm finding NLP applications of monadic parsing as in "Monads for natural language semantics" by Chen though still theorical afaik. They thrive to enrich compositionality starting from programming language denotational semantics resulting from a version of a recursive descent parser obtained by monadic parsing as studied by Wadler.

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

#72
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!

Currently we're a small team mostly based in Sunnyvale, but we're also partly distributed and have some people in Minneapolis. This has been a bit awkward for the class specifically because teaching people over Hangouts turns out to be hard, but there is certainly some cool work going on in Minneapolis.

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

#73
post #66
post #65

Earlier quoted context omitted.

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.

Binary trees, with the operation being to join two trees at the root, form a magma which should quite clearly be non-associative (and thus not a semigroup).

There are of course other examples of sets equipped with non-associative binary operations (for example, 3-dimensional vectors with the cross product), but those typically have extra structure that you will want to exploit which "non-associative magma" cannot capture, and talking about them as magmas will probably feel somewhat artificial unless you have a good reason for ignoring all that structure.

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

#74
post #42

Earlier quoted context omitted.

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/

I cannot agree more. This book is awesome!

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

#75

Earlier quoted context omitted.

I'm slowly developing a systematic framework for programming the human brain with foundations in category theory. I've gotten a lot of useful mileage out of what little I've learned about category theory. It contributes to my intuition about how to reprogram my brain. I'm convinced we'll be teaching it to children in the future, once the programming framework is better developed and understood. What could be more pra…

I'm curious to hear of a few examples of how you're doing that. Would you mind sharing?

I gave some examples in my comment at the bottom of this thread. If you're asking for specific ways I'm using CT in the context, it's mostly as a way to model my experiences and find bits of insight here & there, so specifics are a little hard to come by.

Heh...and as I typed that, I came by some:

The concept of opposite categories is surprisingly useful & gives me comfort when worrying about messing with my mind. If my brain is simply one big personalized category, then anything it can learn can be unlearned.

The concept CT constructions have duals is also really helpful. One thing it suggests to me is anything learned accidentally (and/or temporarily) can be learned intentionally. A specific way this works: synesthesia (cross-wiring of senses, eg. seeing colors in response to hearing music) occurring accidentally, synesthesia temporarily occurring from drugs, and intentionally learning synesthesia. Dualism is a predictive tool in this case.

A way dualism helps me explain some things I've experienced is it suggests mental mechanisms (such as the creation of very different identities beyond the core identity) can fire in functional & dysfunctional ways. I accidentally spawned second & third identities, one of whom is female. It happened through a joyful process, though, and not trauma. The dissociation used is fairly superficial and the goal of creating more is as a continuous process of integrating all of them into a core identity. CT also helps me think about our relationships & how I'm growing through them.

One last example would be the law of composition in CT: if there exists A->B (an arrow from A to B) and B->C, then there exists A->C. Specifically, there exists a way to get from one mental state A to mental state Z that goes through B->...->Y and by experiencing that path, we can learn to shorten it til we can go straight from A to Z. I went through a bit of a path to accidentally create the second identity. The third one was a bit more intentional & took less time to pull off.

If that doesn't answer your question, would you be willing to ask a more specific question in terms of what you'd like to hear examples of?

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

#76
post #72
post #55

Earlier quoted context omitted.

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!

Currently we're a small team mostly based in Sunnyvale, but we're also partly distributed and have some people in Minneapolis. This has been a bit awkward for the class specifically because teaching people over Hangouts turns out to be hard , but there is certainly some cool work going on in Minneapolis.

As someone in the Twin Cities, BAH, I was hoping to find more haskellers around. Oh well, I'll keep trying to get more FP stuff in where I work at least.

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

#77
post #66
post #65

Earlier quoted context omitted.

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.

FWIW, I always thought giving the concept of "magma" its own word was a bit silly.

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

#78

Earlier quoted context omitted.

Fascinating, are you writing this up anywhere?

Yep. It's mostly notes right now. Luckily, I met someone a few days ago who's going to help me distill my research into something people can easily understand. The goal is to setup an open source, open participation science experiment for testing my hypotheses at ourfirstmind.com

Nice! (Your DNS is down at the moment, non-validation of WHOIS data. What a world.)

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

#79

Earlier quoted context omitted.

Yep. It's mostly notes right now. Luckily, I met someone a few days ago who's going to help me distill my research into something people can easily understand. The goal is to setup an open source, open participation science experiment for testing my hypotheses at ourfirstmind.com

Nice! (Your DNS is down at the moment, non-validation of WHOIS data. What a world.)

Thanks for the heads-up! I'll need to resolve that ASAP since the first thing going on the site is my resume & it's almost done!
Post reply on HN