4 ms·
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 us
by elnatro 5y ago
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.
- Jhsto 5y agoThis series has some C++ examples alongside Haskell: https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/ https://bartoszmilewski.com/2014/10/28/category-theory-for-p... and acquirable as a PDF at https://github.com/hmemcpy/milewski-ctfp-pdf https://github.com/hmemcpy/milewski-ctfp-pdf
- cashsterling 5y agoCambridge Quantum Computing applies Category Theory to development of quantum computing algorithms. Recent paper by Bob Coecke: https://arxiv.org/abs/2110.05327 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.
- bern4444 5y agoI 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 https://sambernheim.com/blog/building-a-monad
- vkk8 5y agoSeven Sketches in Compositionality by Spivak and Fong (https://math.mit.edu/~dspivak/teaching/sp18/7Sketches.pdf 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 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 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.
- meiji163 5y ago> 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).
- alde 5y agoThis 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.
- Epa095 5y agoFreeman 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.
- Koshkin 5y agoThis 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.
- mdm12 5y agoI 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/ https://fsharpforfunandprofit.com/posts/recipe-part2/
- Twisol 5y agoI 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/ https://fsharpforfunandprofit.com/rop/ [1] https://blog.ploeh.dk/2017/11/13/endomorphism-monoid/ https://blog.ploeh.dk/2017/11/13/endomorphism-monoid/
- Twisol 5y agoThat 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/ http://blog.ezyang.com/2010/06/databases-are-categories/
- lapinot 5y agoThis 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) https://en.wikipedia.org/wiki/Monoid_(category_theory) which is a categorification of it.
- DarylZero 5y agoHaskell is why it's relevant =D
- lapinot 5y agoFor haskell programmers most likely! Just like there's only the obvious way in which groups are useful for speed cubers.
- mbrodersen 5y agoNot 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.