I would be willing to drink the kool-aid if I saw it being used in a practical way. I always feel these posts are filled with category theory jargon without ever explaining why any of the jargon is relevant or useful. I’ve even watched some applied category theory courses online and have yet to feel I’ve gained anything substantive from them. However, as I started off with, I’m always willing to try something out or…
> I always feel these posts are filled with category theory jargon The 80/20 rule really applies here. Most of the time there's only a few key type classes that people use. Pretty much just Monad, Monoid, Applicative, Functor. If you grok those, then what people say makes a lot more sense. > Can anyone give me a practical applied way in which category theory is a benefit to your design Monad is probably the best exam…
Why I am learning category theory
171–180 of 224 posts
Re: Why I am learning category theory
#172> Category theory is literally the mathematics of boxes (objects), arrows (morphisms), and composition. As I've learned more about category theory (and its applications), I've found string diagrams to be a really nice tool. But string diagrams flip the above around -- morphisms are boxes , and objects are wires . A wire is just a point-to-point link; it doesn't do anything on its own, it just connects a port of one t…
Re: Why I am learning category theory
#173I would be willing to drink the kool-aid if I saw it being used in a practical way. I always feel these posts are filled with category theory jargon without ever explaining why any of the jargon is relevant or useful. I’ve even watched some applied category theory courses online and have yet to feel I’ve gained anything substantive from them. However, as I started off with, I’m always willing to try something out or…
Category theory is to functional/declarative programming what design patterns are to OO programming. Patterns for decomposing problems and composing solutions. To ask “How is it useful?” Is to ask “How are design patterns useful in OO?”. But you already know the answer… Is there an advantage over just inventing your own vocabulary? Yeah! You don’t have to reinvent 70+ years of Mathematics, or teach your language to o…
What do those 70 years of mathematics do for me as a software engineer?
>or teach your language to other people before you can have a meaningful design discussion.
It's the other way around. Most engineers will have no clue what you are saying.
Re: Why I am learning category theory
#174Earlier quoted context omitted.
I'm curious why you call out constructivism. I've only really seen constructivism talked about by people who actually have a strong math background. Because it is hard to speak out against, say, the classical notions of existence that say that there are more real numbers than rational ones unless you actually understand why the classical proofs don't work constructively. And not just as, "We don't allow that proof."…
> I've only really seen constructivism talked about by people who actually have a strong math background. Which I don't mind. If you know your maths, your logic and ideally even your philosophy it's perfectly fine to work in constructivism or even prefer it. But I've definitely seen some dumb, uninformed hot takes about how maths is just this big conspiracy that doesn't allow dissenting opinions because they've seen…
Re: Why I am learning category theory
#175Earlier quoted context omitted.
> I always feel these posts are filled with category theory jargon The 80/20 rule really applies here. Most of the time there's only a few key type classes that people use. Pretty much just Monad, Monoid, Applicative, Functor. If you grok those, then what people say makes a lot more sense. > Can anyone give me a practical applied way in which category theory is a benefit to your design Monad is probably the best exam…
Looks like to the hard part is ‶handl[ing] all the locking and concurrency″ with a pretty interface; that it satisfies the definition of a monad is a convenience because the `do` keyword requires it, but so would it be if it satisfied any other one, wouldn't it?
1. Because the underlying concept for handling composing locks (STM, which I don't know much about, but I'm going to assume is a way to wrap operations within a transaction) is sound
2. it is easy to define the corresponding monad
3. which makes it usable in a do notation
4. producing readable and future-proof code
The step 2 is almost trivial, 1 is where the thinking is at. The do notation is nice to have, but not that important (to me at least). I have no problem writing this in CPS style when using javascript or c++:
const transfer = (x, from, to, onSuccess, onError) => {
return getAccountMoney(from, (f) => {
if (f {
return setAccountMoney(to, t+x, () => {
return setAccountMoney(from, f-x, onSuccess, onError);
}, onError);
}, onError);
}, onError);
}
}
The main point is that I can add 80 edge cases to this and it will continue to compose nicely, not a
single lock in sight.Re: Why I am learning category theory
#176Earlier quoted context omitted.
Category theory is to functional/declarative programming what design patterns are to OO programming. Patterns for decomposing problems and composing solutions. To ask “How is it useful?” Is to ask “How are design patterns useful in OO?”. But you already know the answer… Is there an advantage over just inventing your own vocabulary? Yeah! You don’t have to reinvent 70+ years of Mathematics, or teach your language to o…
>You don’t have to reinvent 70+ years of Mathematics What do those 70 years of mathematics do for me as a software engineer? >or teach your language to other people before you can have a meaningful design discussion. It's the other way around. Most engineers will have no clue what you are saying.
You mean other than inventing the entire industry in which you work? It's a weird question that I have no idea how to answer for you.
What is 70+ years of computer science doing for you as a software engineer? Are you standing on the shoulder of giants; or are you inventing/re-discovering everything by yourself from first principles?
>It's the other way around. Most engineers will have no clue what you are saying.
So how do engineers understand each other if we all invent our own meta-language to speak about software design in the abstract?
Misscommunication is what happens by default unless you intentionally become part of a community and learn the meta-language. Mathematics is one such community which has existed for millenia and benefits from the network effect. It's an anti-entropy thing.
There are many parallels here to the Tower of Babel.
Re: Why I am learning category theory
#177Earlier quoted context omitted.
Category theory is to functional/declarative programming what design patterns are to OO programming. Patterns for decomposing problems and composing solutions. To ask “How is it useful?” Is to ask “How are design patterns useful in OO?”. But you already know the answer… Is there an advantage over just inventing your own vocabulary? Yeah! You don’t have to reinvent 70+ years of Mathematics, or teach your language to o…
>You don’t have to reinvent 70+ years of Mathematics What do those 70 years of mathematics do for me as a software engineer? >or teach your language to other people before you can have a meaningful design discussion. It's the other way around. Most engineers will have no clue what you are saying.
more pragmatically, libraries like redux, react are heavily influenced by concepts from functional programming, rust has novel concepts from type theory, data engineering in the cloud age leverages a lot of algebraic concepts to achieve massive data throughput. We have parser combinators, lambdas, stronger typing, map and flatmap in most languages these days. These all come directly from mathematics.
Re: Why I am learning category theory
#178> Category theory is really the mathematics of abstraction Mathematics is the mathematics of abstraction. That's all you're doing in math, from the beginning to the end. What's the same between "I have two sheep in this pen and five in that one" and "I have two apples in this basket and five in that one"? Hmm, you can abstract out 2+5=7, since it works the same in both contexts. Everything in math is creating and exp…
Re: Why I am learning category theory
#179I would be willing to drink the kool-aid if I saw it being used in a practical way. I always feel these posts are filled with category theory jargon without ever explaining why any of the jargon is relevant or useful. I’ve even watched some applied category theory courses online and have yet to feel I’ve gained anything substantive from them. However, as I started off with, I’m always willing to try something out or…
I’m a math major. I learned category theory in school. I think of category theory as an easy way to remember things. If some concept can be expressed as category theory, it can often be expressed in a very simple way that’s easy to remember. However, if you try to teach math using category theory from the beginning, it feels a little like trying to teach literature to someone who can’t read yet. Anything directly use…
Re: Why I am learning category theory
#180As someone with a maths degree, yet who admittedly hasn't looked into category theory beyond some basic notions, I still don't quite understand why anyone would want to learn category theory before e.g. abstract algebra or even just fundamental mathematical reasoning (definition, theorem, proof). Maybe I'm missing something but it seems to me that all you can study monads in programming languages without having to al…
I agree with you. CT seems mostly useful as a way of devising entirely new abstractions, but once those abstractions are developed, you don't need CT to use them. For example if it were 2008 and you want to be inventor Applicative functors for use in Haskell, then knowing lax monoidal functors from CT might be helpful. But if you want to just use Applicative functors, you don't need to learn lax monoidal functors fir…
Your description is the single best sales pitch for learning it that I've ever heard. I'm legitimately interested now — in a way that I simply wasn't before your comment.
Everyone else who tries to hype up CT is always like, "Whoa, bro, don't you know that addition is actually a monoid endofunctor over the set of all hyper-reals?" (Or something.) I guess that sort of breathless mathematical revelation is supposed to be so mind-blowing that anyone who hears it gets instantly hooked. My usual response was always just, "So what?"
But you're telling me I can become a better engineer? A meta-engineer, who can engineer things to engineer with? Yeah, I'd definitely be up for that.