Live data from Hacker News

Programming with Categories

brendanfong.com

61–70 of 113 posts

Re: Programming with Categories

#61
post #4

In my experience, Monad, Applicable, and Monoid are probably the only ones I'd use in Haskell, and maybe none of them in languages without good inference and general support. Pretty wild ideas, though. Fair chance they'd be more confusing than using more specifically named instances, but solid ideas where the class instance documents that you're using the pattern, instead of describing the preferred interface.

I think it isn’t often said that one reason a lot of these classes work in haskell is the lazy evaluation (or arguably the pure functions allowing the compiler to inline things and skip evaluation).

You can write monoid and foldable interfaces in java but in haskell finding the head of a list with a monoid and foldmap is constant time (and the first or last element of a tree is logarithmic) but a java implementation would be linear.

Re: Programming with Categories

#62

Earlier quoted context omitted.

ZFC does not suffer from Russel’s paradox, since it doesn’t allow a “set of all sets”. If it did, the search for new foundations would be much more widespread. New foundations are usually only considered seriously once they can be shown to be relatively consistent with ZFC or the slightly stronger but still uncontreversial TG set theory. There are people working on categorical foundations, but the main reason for lac…

It is not true that "basically every field uses its concepts and notation to some degree at this point." In particular this is false for mainstream combinatorics, PDE, and probability theory, to give a few examples. In fact, I would suggest that most mathematicians don't care about category theory at all.

> most mathematicians

Agree, but only on the level on which they do not care about the abstract math (algebra, topology, etc.) in general. As soon as you step into the territory of the abstract math, especially where different disciplines blend, such as homology and cohomology, category theory (and its diagram language) helps a lot to clarify things. (Incidentally, a lot of this stuff is now part of the "applied math" as well, having found its way into theoretical physics, for example.)

Re: Programming with Categories

#63
post #9

David Spivak and other folks at Azimuth Forum[0] have been great at providing high quality discussions on ideas in this course and others. Many thanks. [0] https://forum.azimuthproject.org

Is this Spivak related to the author of the famous Calculus book?

David and Michael Spivak are not related

Re: Programming with Categories

#65

Earlier quoted context omitted.

ZFC does not suffer from Russel’s paradox, since it doesn’t allow a “set of all sets”. If it did, the search for new foundations would be much more widespread. New foundations are usually only considered seriously once they can be shown to be relatively consistent with ZFC or the slightly stronger but still uncontreversial TG set theory. There are people working on categorical foundations, but the main reason for lac…

It is not true that "basically every field uses its concepts and notation to some degree at this point." In particular this is false for mainstream combinatorics, PDE, and probability theory, to give a few examples. In fact, I would suggest that most mathematicians don't care about category theory at all.

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 subject that maybe most people are not privy to. Anything to do with sheaves or cohomology (which I know factors into some approaches to PDEs) are using categorical ideas.

Every generation, it seems, has some contingent of serious mathematicians who consider category theory marginal in their field of interest. But every generation, that contingent grows smaller as more mathematics as practiced is brought into the fold. Maybe they're coming for you next :)

Re: Programming with Categories

#66
post #62

Earlier quoted context omitted.

It is not true that "basically every field uses its concepts and notation to some degree at this point." In particular this is false for mainstream combinatorics, PDE, and probability theory, to give a few examples. In fact, I would suggest that most mathematicians don't care about category theory at all.

> most mathematicians Agree, but only on the level on which they do not care about the abstract math (algebra, topology, etc.) in general. As soon as you step into the territory of the abstract math, especially where different disciplines blend, such as homology and cohomology, category theory (and its diagram language) helps a lot to clarify things. (Incidentally, a lot of this stuff is now part of the "applied math…

I'm not sure I'm comfortable characterizing the fields where category theory is useful as "abstract math." Modern PDE is plenty abstract, for example. Probably it's better to say that the usefulness of category theory is proportional to the problem's distance from algebraic topology and algebraic geometry.

I also am reluctant to characterize theoretical physics as "applied math." I haven't seen anyone who calls themselves an applied mathematician use category theory in a substantive way (where here I am thinking about numerical computing, mathematical biology, and so on).

Re: Programming with Categories

#68
post #4

In my experience, Monad, Applicable, and Monoid are probably the only ones I'd use in Haskell, and maybe none of them in languages without good inference and general support. Pretty wild ideas, though. Fair chance they'd be more confusing than using more specifically named instances, but solid ideas where the class instance documents that you're using the pattern, instead of describing the preferred interface.

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.

Re: Programming with Categories

#69

Earlier quoted context omitted.

It is not true that "basically every field uses its concepts and notation to some degree at this point." In particular this is false for mainstream combinatorics, PDE, and probability theory, to give a few examples. In fact, I would suggest that most mathematicians don't care about category theory at all.

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 of value, but it's also a different question.

Also, in no way are sheaves or (co)homology essentially category-theoretic ideas. It's possible to develop and use these ideas without mentioning categories at all (and e.g. Hatcher's introductory textbook does just this, although he mentions in an appendix the categorical perspective later). In general I think it's good to remember that homological algebra and category theory are not the same subject. Sure, I can develop a theory of chain complexes over an arbitrary abelian category, but most of the time you just need Hom and Tor over a ring. (Again, see Hatcher.)

Finally, I'm not sure there has been a serious uptake in category theory in the mainstream of some field of mathematics since, I don't know, at least 50 years ago? We've understood for a while now what it's good and not good for. This hasn't stopped people from trying to inject it in fields where it doesn't do any good (e.g. probability), but for that reason those attempts are mostly ignored.

Re: Programming with Categories

#70
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…

ZFC does not suffer from Russel’s paradox, since it doesn’t allow a “set of all sets”. If it did, the search for new foundations would be much more widespread. New foundations are usually only considered seriously once they can be shown to be relatively consistent with ZFC or the slightly stronger but still uncontreversial TG set theory. There are people working on categorical foundations, but the main reason for lac…

I have only an MA in math - but I have the impression mathematicians can be arranged on spectrum between ad-hoc theorem provers and giant machinery builders, between those like Paul Erdős and those Alexander Grothendieck.

The thing to keep in mind is that a mathematical structure can be expressed as instance of any number of more general mathematical structures ("mathematical machinery"). The structures that useful, however, are those that are "illuminating", a somewhat vague criteria but one which generally include a structure facilitates and unifies proofs of important theorems. Wiles' proof of Fermat's Last Theorem showed the value of many forms of this mathematical machinery [1], including category theory.

At the same time, I think things like Godel theory of cutting down proofs and Chaitin's Omega constant give a suggestion that the some number of "important" theories within a given axiomatic system will have long proofs that don't necessarily benefit from the application of a given piece of mathematical machinery, whatever that machinery.

And think that's related to efforts to apply category theory to programming via functional programming. I feel like it's an effective method for certain kinds of problems but that you get a certain problematic "it's the best for everything" evangelism that doesn't ultimately do the approach favors.

[1] https://en.wikipedia.org/wiki/Wiles%27s_proof_of_Fermat%27s_...

Post reply on HN