News for hackers. Stuff that matters.
Re:Category Theory: Lecture Notes and Online Books by elnatro on Thursday December 30, 2021 @06:36AM (#29735889)
I find this topic fascinating but hard to start with.

Does anyone have any non-Haskell example of category theory? Something that shows why is useful with a use-case.

Re:Category Theory: Lecture Notes and Online Books by alde on Thursday December 30, 2021 @06:48AM (#29735967)
This might be an unpopular opinion, but category theory isn't very useful at low levels of abstraction. It is an elegant mental framework/model that can be used to generalize many concepts, but in my experience such generalizations rarely give additional insights about the concept it is generalizing.
Re:Category Theory: Lecture Notes and Online Books by Epa095 on Thursday December 30, 2021 @04:07PM (#29741445)
Freeman Dyson said:

>Some mathematicians are birds, others are frogs. Birds fly high in the air and survey broad vistas of mathematics out to the far horizon. They delight in concepts that unify our thinking and bring together diverse problems from different parts of the landscape. Frogs live in the mud below and see only the flowers that grow nearby. They delight in the details of particular objects, and they solve problems one at a time. Mathematics needs both birds and frogs. Mathematics is rich and beautiful because birds give it broad visions and frogs give it intricate details.

It is my impression that those loving category theory are predominantly birds. I am a frog, and never really got the love for category theory.

Re:Category Theory: Lecture Notes and Online Books by Koshkin on Thursday December 30, 2021 @07:49AM (#29736285)
This may be true if you take one concept (category) in isolation. But the power of category theory is in revealing hidden analogies between different concepts. Which is why it is an important tool in the areas like algebraic topology.
Re:Category Theory: Lecture Notes and Online Books by vkk8 on Thursday December 30, 2021 @06:47AM (#29735965)
Seven Sketches in Compositionality by Spivak and Fong (https://math.mit.edu/~dspivak/teaching/sp18/7Sketches.pdf) is supposed to be very practical. It includes many examples, but I'm not sure how useful category theory actually is in the example cases.

There is the theory of monotone co-design (https://co-design.science/index.html) which is formulated using category theory. It seems pretty practical.

Then there's topological data analysis, which is clearly a practical subject, and can be formulated in terms of category theory: https://en.wikipedia.org/wiki/Topological_data_analysis

I'm not very knowledgeful of any of these subjects, but I, like you, got somewhat interested in category theory and tried to find how and where it's used some time ago. These are the main things I found.

Re:Category Theory: Lecture Notes and Online Books by meiji163 on Thursday December 30, 2021 @09:50AM (#29737125)
> I'm not sure how useful category theory actually is in the example cases.

It's hard to say that category theory is "applied" to this or that problem. you'll hear many mathematicians call it "abstract nonsense" half-jokingly. More than anything it's a unified way of talking about mathematical structures that gives you a certain point of view (which is where it might be useful).

Re:Category Theory: Lecture Notes and Online Books by lapinot on Thursday December 30, 2021 @12:20PM (#29738638)
This feels to me like "is there any non rubik's cube example of group?". Category theory is a mathematical tool used by mathematicians and built for mathematicians, so you'll have trouble understanding why it's concretely relevant anyway if you're not in the business of doing maths :D The main motivation is that it's a good language for describing some kinds of objects and writing proofs about them.

I'm personaly using category in the field of logic and language semantics (describing and proving stuff about notions of equivalence between programs, results like language X can interpret language Y with such and such fidelity). At a high level, i think category theory is useful in that realm because it enables to make up new structures (algebraic structures, think some set with operations and laws) which will be specific to you (won't be something well known like ring or whatever) but thanks to category theory you'll already have results on these structures because you'll show that they have some generic constructions.

In general category theory sometimes enables mathematical statements to drastically cut down on unimportant assumptions, getting at the real core of some theorem. By doing that, you're enabling other to reuse some result in settings which are "kinda similar", where "morally stuff work in the same way", but where the classical definition would have been too rigid.

edit: concretely about these generalizations: if you know about monoids, then look at https://en.wikipedia.org/wiki/Monoid_(category_theory) which is a categorification of it.

Re:Category Theory: Lecture Notes and Online Books by DarylZero on Thursday December 30, 2021 @12:54PM (#29739149)
Haskell is why it's relevant =D
Re:Category Theory: Lecture Notes and Online Books by mbrodersen on Thursday December 30, 2021 @09:01PM (#29743998)
Not at all. I am an experienced Haskell developer and have had zero usage for Category Theory in my work. I have read and understood Category Theory because it’s fun to learn new abstract math. But I learned a lot more from learning Coq/Lean/Idris.
Re:Category Theory: Lecture Notes and Online Books by lapinot on Thursday December 30, 2021 @01:12PM (#29739424)
For haskell programmers most likely! Just like there's only the obvious way in which groups are useful for speed cubers.
Re:Category Theory: Lecture Notes and Online Books by mdm12 on Thursday December 30, 2021 @07:01AM (#29736029)
I feel like Scott Wlaschin uses an effective model of teaching concepts closely related to category theory without intimidating learners with mathematical definitions and verbiage. Railway oriented programming is a good example.[1]

My personal opinion is that category theory's main contribution to computer science is aiding composability in strongly typed languages in a type-safe, elegant manner. In the end, software is about breaking down a problem into smaller pieces, implementing and testing them, and them putting the pieces back together. Concepts from category theory provide a rigorous foundation for such compositions.

[1] https://fsharpforfunandprofit.com/posts/recipe-part2/

Re:Category Theory: Lecture Notes and Online Books by cashsterling on Thursday December 30, 2021 @02:28PM (#29740414)
Cambridge Quantum Computing applies Category Theory to development of quantum computing algorithms. Recent paper by Bob Coecke: https://arxiv.org/abs/2110.05327. Look up more papers by Bob Coecke and co-authors on Arxiv.

Cambridge Quantum Computing and Honeywell Quantum Solutions recently merged to form Quantinuum. I work on the hardware side at Quantinuum. I don't actually use or apply Category Theory on a day to day basis but I know it is useful.

Re:Category Theory: Lecture Notes and Online Books by Twisol on Thursday December 30, 2021 @07:26AM (#29736159)
I find it most useful as a kind of conceptual organization. It's not something you'd directly solve problems with, but rather a way of organizing your work on the solutions. In that sense, it's much like software architecture -- you don't directly solve problems with architecture, either, but you do want an architecture that supports you when you need to make changes or grapple with a large or complex problem domain.

Unfortunately, that's also why most resources directly on category theory are deeply wedded to pure mathematics -- it's an architectural form that has been developed by mathematicians to organize their own constructions. Folks like Scott Wlaschin [0] and Mark Seemann [1] have, I think, much more success in teaching categorical concepts in a software context, but since their material is often so far removed from category theory "proper" (intentionally and for good reason), they don't really paint much of a path toward category theory themselves.

(I've recently been learning Agda, a dependently-typed language / proof assistant, and it's kind of shocking how often refactoring my proofs lead to more "obviously categorical" concepts. I really think there's something to this category-theory-as-mathematics-architecture angle.)

[0] https://fsharpforfunandprofit.com/rop/

[1] https://blog.ploeh.dk/2017/11/13/endomorphism-monoid/

Re:Category Theory: Lecture Notes and Online Books by Twisol on Thursday December 30, 2021 @07:31AM (#29736184)
That said, Spivak's work on framing databases in terms of categories [2] is pretty fascinating, and might be worth poking at.

[2] http://blog.ezyang.com/2010/06/databases-are-categories/

Re:Category Theory: Lecture Notes and Online Books by bern4444 on Friday December 31, 2021 @11:41AM (#29749674)
I wrote this article[0] as part of my own journey to understand monads and category theory.

I think you may find it helpful. It has a practical use case that builds up an intuitive model to a new monad. It goes through a few solutions for a stated problem which solve increasing requirements and eventually coalesces into writing a new monad as a complete solution to resolve all the built up requirements.

[0] https://sambernheim.com/blog/building-a-monad

Re:Category Theory: Lecture Notes and Online Books by Jhsto on Thursday December 30, 2021 @01:38PM (#29739766)
This series has some C++ examples alongside Haskell: https://bartoszmilewski.com/2014/10/28/category-theory-for-p... and acquirable as a PDF at https://github.com/hmemcpy/milewski-ctfp-pdf