Live data from Hacker News

Programming with Categories

brendanfong.com

81–90 of 113 posts

Re: Programming with Categories

#81

Earlier quoted context omitted.

This all hinges on "mainstream". For example, in combinatorics, combinatorial species are a vast organization of the all-important concept of generating function . They were developed by category theorists and are most tidily organized along categorical lines. If you don't think this is close enough to mainstream, I can't dispute that. It's a value judgment. There is often an undercurrent of category theory within a…

Respectfully, I disagree. The question of what's mainstream and valued by the community is empirical and can be answered by looking at what's published in the leading combinatorics journals. And anyone can check those out and see that categories are basically absent. So as a sociological fact, I maintain it's far from the mainstream. Whether combinatorialists ought to elevate certain work is of course of a question o…

> Respectfully, I disagree. The question of what's mainstream and valued by the community is empirical and can be answered by looking at what's published in the leading combinatorics journals. And anyone can check those out and see that categories are basically absent. So as a sociological fact, I maintain it's far from the mainstream.

I think it is also a reasonable interpretation to take "mainstream" as "pertaining to the main subject matter of the field". Anyway, I think it is the case that the mainstream of combinatorics or probability is yet so big that a particular researcher or even group of researchers can be comfortably in the mainstream and yet have never cared for or even heard of some other line of research that is also mainstream.

The founding paper of combinatorial species [1] has hundreds of citations including many in what I gather are top journals in combinatorics, and even some in the Annals of Probability. So, what are we to make of that? Some people who are serious enough about combinatorics or probability to get published in serious journals have read, perhaps understood, and maybe even taken seriously some of these categorical ideas?

In any case, I respect your viewpoint. In my youth I was a bit category-crazy, trying to use it to organize all of my mathematical knowledge. I'm much more prudent about it these days but I'm still an optimist that we will find more unifying ideas in mathematics through it.

[1] https://www.sciencedirect.com/science/article/pii/0001870881...

Re: Programming with Categories

#82
post #78

Earlier quoted context omitted.

People don’t generally take category theory because they don’t really understand how proofs work or how to read definitions. The maturity required is about being able to cope with proving things and following proofs based on definitions which will probably seem somewhat bizarre at first and unmotivated at first. The immaturity you seem to talk about is people taking category theory because they don’t know category th…

Isn’t an endofunctor a morphism from/to the same category? So a functor would be any morphine from/to different categories, and that wouldn’t be an endofunctor? Endofunctor: A -> A, for category A Functor: A -> B, for categories A and B

More or less. "Morphism" is defined by the category it lives in, so a functor is a morphism between categories in the category of (small) categories. (Insert technicalities about size concerns and Russell's paradox.)

In particular, a map between categories that does not preserve composition is not a functor. It is important that F(f;g) = F(f);F(g).

Re: Programming with Categories

#83

Earlier quoted context omitted.

I wish semilattices got more play. They're so ubiquitous when talking about distributed systems. I remember a keynote on eventual consistency in databases that could have been replaced with "make your merge operation the join of a semilattice."

Any resources for semilattices that you do like? I'm also finding them mentioned around CRDT & distributed systems threads.

My all-time favorite is the original LVars paper: https://users.soe.ucsc.edu/~lkuper/papers/lvars-fhpc13.pdf

Re: Programming with Categories

#84
post #43

Earlier quoted context omitted.

> here's a nice video https://www.youtube.com/watch?v=ADqLBc1vFwI OMG. That might just be the funniest god-damned thing I've ever seen in my life. Thanks for sharing that! On a separate note: does anyone know where this footage is originally from? Some WWII movie, I would guess?

https://en.wikipedia.org/wiki/Downfall_(2004_film) Probably one of the best "WWII movies" (it's really only about the final days in the bunker) ever.

Just seconding that Downfall is brilliant. Totally off-topic now, but also extremely good is Das Boot.

Re: Programming with Categories

#85
post #19

I've read a lot about Category Theory, and I'm amazed at the abstraction level that lets you compose with different mathematical domains (geometry, topology, arithmetic, sets, ...). And yet, the current mathematics relies heavily on the ZFC set theory. Why is that ? (Is that assumption even correct ?) From what I've learned so far, the set theory suffers from Russel's Paradox[0] (does the set of all sets that does no…

> And yet, the current mathematics relies heavily on the ZFC set theory. Why is that ? (Is that assumption even correct ?)

Not really. Most working mathematics is done without any particular foundational context (in fact, it's probably done in naive set theory). If you asked a mathematician, they'd tell you they were using ZFC, but only because everyone does; in practice they don't know or care what foundations they're working with.

> From what I've learned so far, the set theory suffers from Russel's Paradox[0] (does the set of all sets that does not contain itself, contains itself ?). That's what motivated the formalization of Type Theory and the invention of Type Systems in programming languages.

Naive set theory suffers from that paradox. ZFC is a minimal "patch" that avoids it (through the rather ugly hack of an axiom schema).

It shouldn't surprise any programmer that most people working in the field would rather use a bodge that lets them use all their existing theorems and avoid having to learn anything new, rather than a new foundational paradigm.

People who care deeply about foundations are working on things like HoTT. But it's just not that important to day-to-day working mathematicians.

Re: Programming with Categories

#86

Earlier quoted context omitted.

Respectfully, I disagree. The question of what's mainstream and valued by the community is empirical and can be answered by looking at what's published in the leading combinatorics journals. And anyone can check those out and see that categories are basically absent. So as a sociological fact, I maintain it's far from the mainstream. Whether combinatorialists ought to elevate certain work is of course of a question o…

> Respectfully, I disagree. The question of what's mainstream and valued by the community is empirical and can be answered by looking at what's published in the leading combinatorics journals. And anyone can check those out and see that categories are basically absent. So as a sociological fact, I maintain it's far from the mainstream. I think it is also a reasonable interpretation to take "mainstream" as "pertaining…

It may the case that combinatorics is large, with mathematicians focused on their own particular sub-specialities, but I still don't believe category theory can properly be construed as "mainstream combinatorics" in any real sense.

Regarding your claim about that paper being cited by papers in top journals, I checked the first five pages of citations in Google Scholar for combinatorics and probability journal papers.

It's cited once in an offhand way in the concluding discussion of "The Cycle Structure of Random Permutations." No categorical concepts are used there. Ditto for the "Independent process approximations" paper (except now cited in the introduction). Another one-sentence mention in the context of background literature appears in "Tree-valued Markov chains derived from Galton-Watson processes." Same for "A Combinatorial Proof of the Multivariable Lagrange Inversion Formula" and "Bijections for Cayley Trees, Spanning Trees, and Their g-Analogues."

There's a one-sentence mention with actual (slight) mathematical content in "Limit Distributions and Random Trees Derived from the Birthday Problem with Unequal Probabilities." But you don't need categories to prove the bijection they're referring to, from what I understand.

In none of these instances is the work used in a substantive fashion, and unless I missed something no paper features the word "category." It's getting cited because authors have a duty to survey any potentially related background literature.

(On page 6 I found "Commutative combinatorial Hopf algebras," which does use a functor form that paper. It was published in a journal that is decent, but very far from the top.)

So, I think we can reject the notion that Joyal's paper has seriously influenced the fields of combinatorics or probability.

I'm sorry to harp on this, but I see claims like yours about the importance of category theory thrown around a lot on here, and often I feel that they're clearly wrong. So I thought it would be good to provide some details this time around.

Re: Programming with Categories

#87

As someone who respects functional programming (because it removes geniuses from competing in my space) here's a nice video https://www.youtube.com/watch?v=ADqLBc1vFwI What is the beautiful monospace font in the pdf here http://brendanfong.com/programmingcats_files/cats4progs-DRAF... ?

> here's a nice video https://www.youtube.com/watch?v=ADqLBc1vFwI OMG. That might just be the funniest god-damned thing I've ever seen in my life. Thanks for sharing that! On a separate note: does anyone know where this footage is originally from? Some WWII movie, I would guess?

I laughed a lot with the video too.

Jokes aside, a book like CTM shows both paradigms have their place, and can also co-exist in the same system.

Besides, this paper cleared all my doubts about high-order FP having a lot of (unexploited) potential:

http://conal.net/papers/compiling-to-categories/

Re: Programming with Categories

#88
post #27

Earlier quoted context omitted.

As so many undergraduate math textbooks say, "No background is assumed beyond sufficient mathematical maturity."

Tautological sufficiency/necessity relativities for an absolute measure are a pet peeve: “How much salt should I add?” “Oh, not too much.” Practically guarantees a withering glare from me.

That's a really great analogy, actually. You can't tell a brand-new cook "salt to taste," but you can tell a cook with an intermediate level of experience "salt to taste" even if it's a recipe they've never made before. You can't impart the experience in words, pictures, or symbols. You can't add a chapter zero that gets them there. But the right kind of experience will get you there pretty quickly.

I admit it's kind of frustrating that it can't be boiled down to a list of discrete things you need to know, but if I had to explain the difference between me before I had "sufficient mathematical maturity" and me after, I would explain it in terms of habit and confidence and other squishy things that aren't mathematical at all.

Re: Programming with Categories

#89
post #79

Earlier quoted context omitted.

Hitler: What's a monad anyway? No one who understands monads can explain what they are Underling (hurriedly): A monad is just a monoid in the category of endofunctors This caused me to choke on my coffee.

> A monad is just a monoid in the category of endofunctors A helpful analogy can be drawn by comparing two facts: a composition of something with its inverse produces the identity (a.k.a. unity , to use the Latin root), while a composition of something (e.g. a functor) with its "adjoint" (not quite the inverse) produces something similar that is better said in Greek.

And thus, another cycle is completed.

Re: Programming with Categories

#90

When taught in January at MIT, a highlight was something I'd not seen elsewhere: someone called it the "aftermath" (3-pun). After the one-hour traditional-ish lecture (on video), the room was reserved for an additional hour. When previously taught, people would remain afterwards to ask questions, discuss math, and chat. So this was an iterative-improvement formalization of that. People would gather in front of the bl…

This is the most valuable part of the in person learning experience. Free form discussion and building intellectual context around a subject. I experienced this in a community college environment. This should be encouraged in any learning environment.
Post reply on HN