Skip to the Main Content

Note:These pages make extensive use of the latest XHTML and CSS Standards. They ought to look great in any standards-compliant modern browser. Unfortunately, they will probably look horrible in older browsers, like Netscape 4.x and IE 4.x. Moreover, many posts use MathML, which is, currently only supported in Mozilla. My best suggestion (and you will thank me when surfing an ever-increasing number of sites on the web which have been crafted to use the new standards) is to upgrade to the latest version of your browser. If that's not possible, consider moving to the Standards-compliant and open-source Mozilla browser.

September 16, 2007

The Catsters on YouTube: “Monads”

Posted by John Baez

You can see all sorts of silly things on YouTube these days — from guys flying in wingsuits to math professors making mistakes converting miles to kilometers. But what about serious stuff? Can you watch math lectures on YouTube?

Can you learn category theory?

Can you, say, learn about monads?

Yes! Now you can!

Just try these videos from the new sensation out of Sheffield — the group that has all the British press raving — the Catsters!

  • Monads 1: Definition of monad. Example: the monad for monoids.
  • Monads 2: Examples, continued. The monad for categories.
  • Monads 3: Algebras for monads.
  • Monads 3a: Answers to some questions.
  • Monads 4: The category of algebras of a monad.

So far it looks like the big star of the Catsters is Eugenia Cheng. However, I hear that Simon Willerton is playing a vital role behind the scenes. Maybe he’ll star in some future videos.

I hope this is the beginning of a new trend: higher mathematics on YouTube!

Posted at September 16, 2007 5:34 PM UTC

TrackBack URL for this Entry:   https://golem.ph.utexas.edu/cgi-bin/MT-3.0/dxy-tb.fcgi/1425

48 Comments & 3 Trackbacks

Re: The Catsters on YouTube

Thanks for that John. We must confess that we hadn’t quite expected such publicity at this early stage. There will be more videos soon!

Posted by: The Catsters on September 16, 2007 8:42 PM | Permalink | Reply to this

Re: The Catsters on YouTube

Dear Catsters:

I look forward to more videos!

For future reference: if you want to keep somehthing away from the glare of publicity, don’t 1) put it on YouTube and 2) tell me about it.

Posted by: John Baez on September 18, 2007 7:35 PM | Permalink | Reply to this

Re: The Catsters on YouTube

For future reference: if you want to keep something away from the glare of publicity, don’t 1) put it on YouTube and 2) tell me about it.

Very fair point - but you do only publicise things you think are cool, so perhaps the Catsters are saying that they didn’t dare expect you to find their videos so cool…

In any case this Catster didn’t quite know what response to expect, and is delighted by the response that the videos are getting! Thank you everyone!

Posted by: Eugenia Cheng on September 19, 2007 12:56 AM | Permalink | Reply to this

Re: The Catsters on YouTube

Blackboards! Mathematicians are hilarious.

Posted by: Kea on September 16, 2007 11:09 PM | Permalink | Reply to this

Re: The Catsters on YouTube

Kea writes, “Blackboards! Mathematicians are hilarious.”
No! blackboards are the media of choice.

But Eugenia should know the sagacity of Serge Lang. When the chalk squeaks, break it into two.

These lectures are fabulous!

Posted by: Scott Carter on September 17, 2007 3:06 AM | Permalink | Reply to this

Re: The Catsters on YouTube

But Eugenia should know the sagacity of Serge Lang. When the chalk squeaks, break it into two.

For “sagacity” read “screams”. I can still hear them to this day when my chalk squeaks.

Posted by: John Armstrong on September 17, 2007 10:49 AM | Permalink | Reply to this

Re: The Catsters on YouTube

It’s not clear what Kea would prefer to a blackboard. While writing on a layer of slate with fossilized seashells may seem downright paleozoic, and some may prefer whiteboards, the basic idea of standing up, talking and writing on a big flat surface really has no equal when it comes to explaining mathematics.

I use computer presentations coupled to webpages for most of my public talks, but only because 1) I want to reach everyone who has access to the internet, 2) I’m too lazy and disorganized to make my videotapes of my own talks, and 3) I want to cover more material, in a more sketchy way, than I can easily do by writing it all on the blackboard.

Point 3) is crucial: for actual classes, where I actually take time to explain things in detail, a computer presentation would be counterproductive. Writing things as you think of them has the useful effect of slowing the presentation down to a more comprehensible pace, and — even more importantly — “illustrating the movement of thought”.

Illustrating the movement of thought is an important aspect of teaching math classes. If the audience sees you writing and thinking aloud as you do calculations, they learn how to do these calculations themselves. A computer presentation is too much deus ex machina. So is a lecture that merely presents results without deliberately going through the false steps that one makes as one figures something out.

Posted by: John Baez on September 18, 2007 7:32 PM | Permalink | Reply to this

Re: The Catsters on YouTube

“If the audience sees you writing and thinking aloud as you do calculations, they learn how to do these calculations themselves.”

IMO that’s on the point and crucial. (And they learn that way not to be afraid of calculations and insecurities occuring before reaching the desired result. At least for me, the thrill of math consists in part in such a tension between the tolerance for insecurity needed to start with something and the security at the end.)

Posted by: T.R. on September 18, 2007 8:49 PM | Permalink | Reply to this
Read the post Not Quite Everything You Never Wanted to Know about Monads
Weblog: Samuel's All-New New News News Page
Excerpt: Via Lambda the Ultimate, I caught wind of these series of videos on YouTube covering monads and category theory. My head is spinning. But, ironically, it is almost as if I can almost make sense of what she's saying, perhaps because of my Haskell experie
Tracked: September 17, 2007 6:31 AM

Re: The Catsters on YouTube

That’s great stuff! Actually I’m dreaming of an Edutube (something with appropriate moderation, funded by the IMU and the likes) which would be featuring only educational videos in all disciplines and at all levels from school to research…

Posted by: Gaspard on September 17, 2007 10:11 AM | Permalink | Reply to this

Re: The Catsters on YouTube

Hi John,

as promised here is a comment ;)
I think this is really a great idea!!
Brava Eugenia!! (Could you speak a little slowlier, please? ;))
Also, why the Catsters as a name?

Posted by: Alessandro on September 17, 2007 11:24 AM | Permalink | Reply to this

Re: The Catsters on YouTube

My guess: if AA is a hipcat and BB is a hipster, then Hom(A,B)\mathrm{Hom}(A,B) (meaning the hip morphisms, of course) would be a catster. But I could be wrong.

Posted by: James on September 17, 2007 1:19 PM | Permalink | Reply to this

Re: The Catsters on YouTube

…plus of course the play on *caster as in webcast, podcast, any sort of broadcast. But I like your explanation better.

Posted by: Stefan on September 17, 2007 4:40 PM | Permalink | Reply to this

Re: The Catsters on YouTube

‘Catster’ seems like a natural blend of ‘category’ and ‘-ster’, which is a suffix for ‘person who does XX’. We’ve got hipsters, mobsters, gangsters, why not catsters?

The play on ‘broadcaster’, ‘narrowcaster’ is just icing on the cake.

Posted by: John Baez on September 18, 2007 7:46 PM | Permalink | Reply to this

Re: The Catsters on YouTube

According to the New Scientist, “An online video site dubbed ‘YouTube for scientists’ was launched last month by the US National Science Foundation and online journal publisher Public Library of Science.”

Posted by: T.R. on September 17, 2007 6:04 PM | Permalink | Reply to this

Re: The Catsters on YouTube

Oh my! What an excellent series of videos!

Thanks for bringing this to our attention.

Posted by: Nick Bornak on September 17, 2007 6:13 PM | Permalink | Reply to this

Re: The Catsters on YouTube

You’re welcome, and thanks for subtly bringing to our attention your blog Mort Aux Triangles — which features among other things a nice discussion of the the category-theoretic approach to model theory!

In case you haven’t bumped into it yet, I gave my own quick intro to this topic in week200 of This Week’s Finds.

Posted by: John Baez on September 19, 2007 4:54 AM | Permalink | Reply to this
Read the post Monads on Video
Weblog: Science After Sunclipse
Excerpt: Tired of strange British comedy videos and musical numbers which just get stranger and stranger? Wishing for some serious mathematics on this Web of ours? Well, consider your wishes fulfilled: Be forewarned — Dr. Cheng goes fast, and she mis...
Tracked: September 18, 2007 6:47 PM

Re: The Catsters on YouTube

Since our automatic trackback facility doesn’t seem to be noting it, I’ll note that someone at the programming blog Lambda the Ultimate has also enjoyed the Catsters’ talks on monads.

Keep ‘em coming, Catsters!

Posted by: John Baez on September 19, 2007 4:40 AM | Permalink | Reply to this

Re: The Catsters on YouTube

There’s also a site which is advancing rapidly (expect big changes soon) called Scitalks. Here scientific videos at all levels are linked to, commented on and hosted. There will be many more features to this site soon.

Posted by: Jonathan on September 19, 2007 4:48 AM | Permalink | Reply to this

Re: The Catsters on YouTube

The future of textbooks?:
“They are making paper with wires, sensors, and computer chips embedded, a technology dubbed ‘Pulp-based’ computing..” ( Article,Video)

Posted by: T.R. on September 20, 2007 8:53 AM | Permalink | Reply to this

Re: The Catsters on YouTube

A semantic-web prognosis:
“The revolution in scientific publishing that has been promised since the 1980s is finally about to take place, according to two University of Illinois experts in information science” and a dystopic version of that.

Posted by: T.R. on August 19, 2009 10:00 AM | Permalink | Reply to this

Re: The Catsters on YouTube

Someone on YouTube is accusing The Catsters of faking their popularity! He sent a message:

> Its [sic] really funny that your [sic] most of
> your subscribers have no videos, are
> subscribed to only you, and have only your
> videos as favorites. Do I sense a youtube
> cheater?

It seems he’s a disgruntled 14-year-old Vlogger who is annoyed that The Catsters have dislodged him from his position as #46 Most Subscribed Guru This Week…he evidently can’t believe that monads could possibly be that popular.

Well, I’m glad that monads are this popular! I actually didn’t realise how popular they were among Haskell people and would be interested to hear more about that.

Posted by: Eugenia Cheng on September 19, 2007 11:59 AM | Permalink | Reply to this

Re: The Catsters on YouTube

The Haskell programming language uses monads to describe sequential computation (e.g. computation involving mutable state and IO).

There are some reasonably good descriptions of the use of monads in haskell in the haskell wikibook on wikipedia:

http://en.wikibooks.org/wiki/Haskell

Posted by: Jeff Marshall on September 20, 2007 1:55 AM | Permalink | Reply to this

Re: The Catsters on YouTube

Jeff,

Could you (or anyone else) possibly give us a bit more of a hint?

I thought that IO is something to do with Old Macdonald, and mutable states are countries where you can stop everyone from talking, right?

Seriously, I looked at the monad description in the wikibook and it appeared rather opaque to this ignorant Catster. Is it possible to say in half a line what kind of categories and functors are kicking around here?

My first guess of why categories would have anything to do with programming is that you might have a category of ‘states’ of your machine with morphisms being ‘transistions’ between states. Am I even close?

Posted by: Simon Willerton on September 20, 2007 11:00 AM | Permalink | Reply to this

Re: The Catsters on YouTube

Simon, I’ve never been able to figure out what monoid object in the endofunctor category of which category makes up a Haskell “monad” either.

But I might be close to an answer, for I am now running a seminar on applications of category theory, and I can assign the grad student working in domain theory and semantics to figure that out and do one or two weeks’ work on that subject. I just hope I don’t go mad with the very moderate amount of power I’ve been given.

Posted by: John Armstrong on September 20, 2007 12:46 PM | Permalink | Reply to this

Catsters, monads, functional programming

The paper that started it all (meaning the introduction of monads into functional programming and computing science) is this one: Notions of computations and monads by Eugenio Moggi. This paper may be easily understandable for many people here, since it is quite difficult to follow for many computing scientist due to its somewhat heavy use of categories :)

I can also try to add some more explanations (but beware of my explanations, since they’re in no way approved by any official and legitimate authority whatsoever, and I have a pretty serious history of being proved wrong).

Monads enter in programming language theory when you want to deal with “effects” (or “side-effects”). Most functional programming semantics are a glorified (and typed) version of lambda-calculus, which is in turn a nice syntaxic representation for cartesian closed categories. The problem with this model, is that you can only implements algorithms in it: functions that produces a specific and deterministic value of your codomain for each value of your domain. In computing science, we want to manipulate more than that: we want to have various types of non-determinism, the more obvious being the presence of state, that is the possibility that some functions share together some “world” (for example a set of values), which they can depend on (that is, picking up some values in it and use them) or transform (that is, replacing some values in the world by some others). This idea is traditionally difficult to model in pure lambda-calculus, because of the mutability of the “world” (ie. of the shared state), mutability that implies an ordering in which access and modification of the world takes place, something that doesn’t fit very well with the lambda-calculus, whose semantics are independant of the evaluation order (up to non-termination issues). So, more broadly than the example of state, you sometimes wants to have effects, meaning that you get “something more” from the function than its result. This is where monads comes into play, via the pretty awesome idea of Moggi.

The basic idea is to associate to each type in your language a computation, which “produce” (more appropriate than “map”, in this case) a value of this type with some possible side-effects, who are specific to the kind of computation you want/need. Each kind of computation can corresponds to a functor, thus mapping objects and arrows (ie. functions, when talking about a programming language) with all the nice functor properties that makes it a real, legitimate, categoric, functor. Most of the times, it will be an endofunctor, because you are going to express your side-effect (hence define your kind of computation) in terms of the original language you’ve got (the Moggi paper give lots of examples). Then, your functor, together with two natural transformations (you can see which ones in the wikibook linked earlier), form a Kleisli triple, which is another way to formulate that you have a monad (this is also explained in Moggi paper). With your Kleisli triple, you can form a Kleisli category corresponding to it, so you’ve got a semantic space to express your computations in, and this space has got nice algebraic properties since it is “generated” by a monad (I use “generated” here because monads have got pretty interesting links with algebras), so you can now reason about computations with all the categorical/algebraic tools you need.

In short, what Moggi found is that monad are a way to express various kinds of effects while maintaining your ability to reason categorically or algebraically about the semantics of your programs. Nowadays, the functional programming community (mainly the Haskell one, more precisely) has produced many monads for many kind of effects (parsing, concurrency, … even a quantum mechanics monad :)). Also, a development of the original idea is the idea of “monad transformers” that are used to combine various effects in one big giant monad; alas, this idea has not been put on a solid theoretical ground yet (or maybe ?) , so it’s done in a ad-hoc way in Haskell right now.

So, have I obscured the issue enough that you now think you should read the Moggi paper ? Mission accomplished then, since Moggi talk about it much better than I do.

Also, you maybe will enjoy the sigfpe blog posts about monads (and as well enjoy the sigfpe blog in general).

PS: Oh my god, I’ve got the tremendous fear of the lurker posting here the first time. Completely terrifying :)

Posted by: renaud on September 20, 2007 6:15 PM | Permalink | Reply to this

Re: Catsters, monads, functional programming

Renaud write:

Oh my god, I’ve got the tremendous fear of the lurker posting here the first time. Completely terrifying :)

Nice post! Don’t be scared: we’ll just send out a team of experts to kidnap you, take you to our headquarters, strap you to a chair and find out if you really know as much about this stuff as you seem to.

Posted by: John Baez on September 20, 2007 9:40 PM | Permalink | Reply to this

Re: Catsters, monads, functional programming

Renaud, thanks for providing the necessary followup to my brief comment.

Part of the reason I didn’t elaborate more is that I’m still investigating the relationship between the Monad type class in Haskell and a mathematicians idea of a monad and I didn’t want to lead Eugenia (or anyone else) too far astray.

Anyway, thanks for the link to the Moggi paper. Last time I looked at it (~ 2 years ago, upon discovering Haskell) I wasn’t ready for it. I’ll give it another shot now that I have some more background knowledge.

Posted by: Jeff Marshall on September 21, 2007 1:02 PM | Permalink | Reply to this

Re: Catsters, monads, functional programming

If I could follow up on renaud’s comment (as a fellow terrified lurker), I think a nice way for category theorists to understand Haskell might be to read the Haskeller’s explanation of category theory!

Halfway down the page you can read about the category Hask, which has Haskell types as objects, and functions over types as morphisms.

The mechanism which allows Haskell to succinctly capture notions like Functor and Monad is the typeclass, which is a grouping of a (type-parameterized) type constructor and some functions on these parameterized types. Eg for Functor, the mapping from objects to objects (types to types) is performed by the typeclass instance, and the mapping from morphisms to morphisms by a single grouped function ‘fmap’.

Instances of the Functor typeclass are the actual functors. Same for instances of Monad.

Watching TheCatsters video on the monad for monoids helped me learn more about the Haskell monad for lists than I did studying Haskell at uni — thanks!!!

Posted by: Allan E on September 22, 2007 4:46 AM | Permalink | Reply to this

Re: Catsters, monads, functional programming

Could I add that at the foundations of Haskell is the typed lambda calculus, as covered earlier this year in the classical vs quantum computation course. I can still remember how dumbfounded I was to see the lambda calculus appear in a quantum gravity seminar: as a CSer I thought all my dreams were about to become reality!

(for those with link-fatigue: it’s a cartoon!)

Posted by: Allan E on September 22, 2007 7:22 AM | Permalink | Reply to this

Re: Catsters, monads, functional programming



I like that cartoon a lot! My dream is indeed to build bridges between the concepts of spacetime, quantum process and computation. I’ve thought a lot about the first two, but I taught that seminar to learn more about the third.
Posted by: John Baez on September 22, 2007 5:19 PM | Permalink | Reply to this

Re: Catsters, monads, functional programming

Since we’re on the subject of monads in computer science, I thought I should point out this fascinating recent paper by Martin Hyland and John Power. If I’m allowed to paint a grotesque caricature, it’s arguing that the use of monads in computer science was all a big mistake caused by a historical accident, and that we would be much happier if we’d just used Lawvere theories instead. And it’s pretty convincing! Well, it convinced me. Essential reading for anyone who cares at all about this kind of thing, I say.

Posted by: Robin on September 22, 2007 6:14 AM | Permalink | Reply to this

Re: Catsters, monads, functional programming

Interesting! I’ll read it, but I’ll ask you anyway — do they mean ‘Lawvere theories’ in the literal sense, or the general idea of algebraic semantics where models of theories are structure-preserving functors? Don’t you at least need to go beyond categories with finite products (Lawvere theories) to cartesian closed categories to get most of the juicy ‘computation’ stuff?

Posted by: John Baez on September 22, 2007 5:22 PM | Permalink | Reply to this

Re: Catsters, monads, functional programming

Before I answer your question, I feel I should seek forgiveness for the grotesqueness of my earlier caricature by giving a slightly more nuanced account of what the paper is about.

It begins by describing Lawvere theories (in the literal sense, as you describe) and describing some of the nice properties of the category of Lawvere theories, including the fact that you can sum and tensor them. (The former is especially interesting in the context of computational effects, since the sum operation corresponds to a very simple and natural notion of combination of such effects; as renaud mentions in his comment above, people have been really struggling to find a good way to deal with this sort of combination within the theoretical framework of monads, but it’s easy with Lawvere theories!)

The paper then goes on to describe the relationship between Lawvere theories and monads, and explain how the latter are more general but have fewer nice properties.

Next they consider the question of why, in light of this, monads became the dominant categorical approach to universal algebra. This section (section 5) is only three pages long, and I can’t think of a better way to paraphrase it than to quote large chunks of it at you, so I’ll refer you to the paper here. :-)

It goes on to discuss the history of Moggi’s pioneering work on computational effects, which brings me at last to your actual question.

Cartesian closed categories are more or less the foundation of all denotational semantics, and they’re certainly not in question here. The point is really that cartesian closure corresponds to a very pure kind of functional programming, but in the real world programming languages have all sorts of irritating non-pure features, such as mutable state (i.e. variables whose values can be changed) and input/output (IO). [The latter in particular is pretty essential if you want to be able to write programs that do anything useful!] Moggi’s insight was that many of these non-pure features (computational effects) can be described by some (strong) monad over the underlying semantic category. A non-pure function of some kind can then be represented by an arrow in the Kleisli category for the appropriate monad.

What Hyland and Power point out here is that (with one exception that seems to be genuinely qualitatively different) all these monads actually come from finitary algebraic theories; and that moreover this is a more useful way to think about it, because the basic operations of these theories are computationally natural operations (e.g. get and set operations for the state monad, read and write operations for the IO monad, etc.).

I hope I haven’t misrepresented anything too horribly. Go and read it, everyone!

Posted by: Robin on September 22, 2007 6:54 PM | Permalink | Reply to this

Re: Catsters, monads, functional programming

While I’m trying to be accurate, perhaps I should add that (as Hyland and Power clearly explain) there are some places in computer science where monads are used, and where it doesn’t seem possible to replace them with algebraic theories. The semantics of continuations is the prime example. To quote the penultimate paragraph of the paper:

Monads appear quite directly in the study of continuations. So perhaps the notion of monad might be seen as a generalised semantics of continuations? With the unit and counit being regarded as generalised forms of thunk and force?

Posted by: Robin on September 22, 2007 9:42 PM | Permalink | Reply to this

Re: The Catsters on YouTube

I don’t think it’s so much that he can’t believe that monads are that popular. It’s more that what we’re seeing here is a very different behavior to the norm in the YouTube community.

You’ve created a series of videos that appeals to a segment of the “lurker” community within YouTube as well as to a segment of the non-YouTube community. That is, your videos are for some people the first (and so far only) time they see reason to look at YouTube at all, while for other people (like me) they’re the first time they see reason to pay attention to a coninuing series. And since we behave differently than the norm it ends up being a bit suspect.

Posted by: John Armstrong on September 19, 2007 12:45 PM | Permalink | Reply to this

Re: The Catsters on YouTube

Today a Catster comes out from behind the scenes…

Posted by: The Catsters on September 20, 2007 3:21 PM | Permalink | Reply to this
Read the post The Catsters' Latest Hit: "Adjunctions"
Weblog: The n-Category Café
Excerpt: Learn about adjunctions on YouTube!
Tracked: September 20, 2007 6:16 PM

Re: The Catsters on YouTube: “Monads”

Is this really true that Pakistan has blocked YouTube? I don’t seem to be able to call it up from the UK.

Posted by: David Corfield on February 24, 2008 8:59 PM | Permalink | Reply to this

Re: The Catsters on YouTube: “Monads”

I just watched a few Youtube videos, with some (not very significant) delay in downloading time for one of them.

Posted by: Todd Trimble on February 24, 2008 9:36 PM | Permalink | Reply to this

Re: The Catsters on YouTube: “Monads”

It’s back up for me now, but there have been reports from all over about this.

Posted by: David Corfield on February 24, 2008 9:38 PM | Permalink | Reply to this

Re: The Catsters on YouTube: “Monads”

Do you have a Pakistani internet service provider, David? That might explain a thing or two.

Posted by: John Baez on February 25, 2008 7:13 AM | Permalink | Reply to this

Re: The Catsters on YouTube: “Monads”

An article about a new webtool (thanks to Kerry W. for the link):

“In December 2007, Mark Klein of the Center for Collective Intelligence at MIT, Luca Iandoli of the Department of Business and Managerial Engineering at the University of Naples Federico II and Giuseppe Zollo of the Faculty of Engineering at the University of Naples Federico II conducted the first field test of a new Internet-based collaboration platform that Klein calls a “Collaboratorium….In the “Collaboratorium” structure, postings are organized into a logical “argument map” that can be displayed like an outline, so that visitors to the online community can more easily identify the main issues related to a topic. Users also can rate ideas and arguments. The theory is that, for a complex topic like climate change, an argument-based structure may help collective intelligence emerge more effectively than a more free-form posting structure such as a wiki or forum…The first field test of the Collaboratorium - involving 220 engineering graduate students at the University of Naples - yielded some interesting results.”

The paper can be downloaded here.


Posted by: Thomas Riepe on May 14, 2008 8:01 AM | Permalink | Reply to this

Re: The Catsters on YouTube: “Monads”

I really would like to get a firm grasp on the mathematical concept of monads, but I’m feeling a bit lost. What would you guys say are the pre-requirements to understanding monads? Topics I could go learn about to help me in my quest?

TIA.
Daniel

Posted by: zurk on October 22, 2009 5:03 PM | Permalink | Reply to this

Re: The Catsters on YouTube: “Monads”

The only way I could understand monads was through their definition in terms of adjunctions, and the only way I could understand adjunctions was their definition in terms of the natural transformations unit and counit.

For some reason that worked where every other means of explanation failed. I think I found it much easier to understand a monad T when it was broken down into adjoint functors F and G, along with a couple of commuting triangles.

Posted by: Tom E on October 22, 2009 5:13 PM | Permalink | Reply to this

Re: The Catsters on YouTube: “Monads”

I haven’t seen any explanation of Haskell monads in terms of adjunct functors. I think that would be very interesting. It seems to me though that given a monad you can’t easily (if at all) recover the pair of functors that would generate it. What would the second category be?

Posted by: Bartosz Milewski on January 11, 2011 10:38 PM | Permalink | Reply to this

Re: The Catsters on YouTube: “Monads”

It seems to me though that given a monad you can’t easily (if at all) recover the pair of functors that would generate it.

There are two dual “universal” ways to recover such an adjoint pair: the Eilenberg-Moore category and the Kleisli category. And actually, monads in Haskell are essentially defined via their Kleisli categories: the objects of the Kleisli category of a monad m are the types, and the morphisms from a to b are the functions of type a -> m b.

Posted by: Mike Shulman on January 12, 2011 3:20 AM | Permalink | Reply to this

Re: The Catsters on YouTube: “Monads”

To understand monads what you really need is a firm grasp of categories, functors, natural transformations, and the various ways of composing these.

You probably also need to be comfortable with a few examples. It might be sufficient to understand the ‘free group on a set’ functor

L:SetGrpL : Set \to Grp

and the ‘underlying set of a group’ functor

R:GrpSetR : Grp \to Set

It would also be very helpful to understand ‘adjoint functors’ and how the above functors are adjoint to each other.

If you don’t like groups and sets, you can use almost any other pair of ‘free’ and ‘underlying’ functors. The point is to get a good grasp of why some ‘free’ construction is a good thing, why it comes along with an ‘underlying’ construction, and why these are adjoint functors.

Then you have to learn the definition of a monad and work through an example very carefully. In the above case you need to start by understanding

T=RL:SetSetT = R L : Set \to Set

and why there are natural transformations

m:T 2Tm : T^2 \Rightarrow T

and

i:1 SetTi : 1_{Set} \Rightarrow T

Then see why these obey all the monad axioms.

You just have to sit down and budget a few hours to doing it. It’s worth it!

When Jim Dolan first taught me this stuff in a little café near UCR (now defunct), I thought it was ridiculously abstract and pointless. Now of course it seems utterly fundamental!

Posted by: John Baez on October 22, 2009 8:01 PM | Permalink | Reply to this

Re: The Catsters on YouTube: “Monads”

There’s a wonderful paper by Wadler, Monads for Functional Programming, that shows how monads arise naturally in a computer programming context. It does require that you can at least parse ML, since that’s the functional language he uses for his examples.

Posted by: Mike Stay on October 22, 2009 8:18 PM | Permalink | Reply to this

Re: The Catsters on YouTube: “Monads”

Posted by: Toby Bartels on October 22, 2009 9:38 PM | Permalink | Reply to this

Post a New Comment