23 ms·
Despite the name, I’ll note that this says far more about category theory than it does about FP. In fact, I’d argue that it’s not particularly closely related t
by bradrn 4y ago
Despite the name, I’ll note that this says far more about category theory than it does about FP. In fact, I’d argue that it’s not particularly closely related to FP at all — this should have been titled ‘The Dao of Type Systems’, or something along those lines. Certainly, the category-theoretic stuff is very interesting, and can even be quite useful for programming, but Haskell and other functional language can easily be used without any knowledge of category theory whatsoever.
- pdpi 4y ago> Haskell and other functional language can easily be used without any knowledge of category theory whatsoever. Yup! Haskell borrows heavily from category theory, and there's a lot of value in knowing the stuff, but people have also been productive in SQL for decades without any formal knowledge of relational algebra.
- ocschwar 4y agoI'd say lack of knowledge of relational algebra is the root cause of a lot of bad SQL database schema design. (Guilty as charged)
- dragon96 4y agoInteresting, could you give some examples of concepts from relational algebra that have helped inform your understanding of schema design? Asking as a practioner interested in learning the conceptual underpinnings :)
- dgb23 4y agoI think there is a simple, almost obvious, but very powerful concept that gets clearer when learning relational algebra: Everything is a relation. There is an important part about using an SQL DB which is about the engineering side of things, such as access patterns, indexing, efficient storage and so on. And then there is the side that is about relational expressions. An intuition of mine is that people who feel more comfortable with the second part, lean on SQL (and DB features in general) to do work for them, while eschewing things like ORMs.
- mbrodersen 4y agoI know Category Theory quite well but have never used it for anything practical. Do you have any examples of practical solutions that benefitted more from Category Theory than just straight forward algebraic thinking?
- andai 4y agoInteresting, can you suggest some subjects that should be covered in a Dao of Functional Programming book? (Or perhaps recommend other books on the subject?)
- carapace 4y ago> I’ll note that this says far more about category theory than it does about FP. In fact, I’d argue that it’s not particularly closely related to FP at all I'd say CT is FP. FP is about doing algebra to derive programs and CT is the math that describes that. In Manfred von Thun’s article "Joy compared with other functional languages" ( https://www.kevinalbrecht.com/code/joy-mirror/j08cnt.html https://www.kevinalbrecht.com/code/joy-mirror/j08cnt.html ) he asks, > Could the language of categories be used for writing programs? Any lambda expression can be translated into a categorical expression, so the language of categories is expressively complete. But this does not make it a suitable language for writing programs. As it stands it is a very low-level language. I think this book could be seen as the (affirmative) answer to that question.
- nlitened 4y ago> FP is about doing algebra to derive programs I don’t think I can agree. Clojure is a functional programming language, but is far from doing any algebra.
- edgyquant 4y agoI don’t know about clojure but lisp definitely counts as an abstract algebra (and not in the same way most other languages are.) It’s also a weird derivation of set theory allowing it to be derived from first order logic.
- throwawaymaths 4y agoHaving studied abstract algebra, I disagree that the soul of lisp is abstract algebra. You're not really actively thinking algebraically when you're writing lisp, not in the same way that other languages have you "actively thinking about category theory". There are also other modern FP languages that are "basically lisps", like Julia or Elixir, that would be hard to call "algebraic".
- carapace 4y agoMy opinion (and I don't insist that I'm right) is that you've got to go back to Backus' Turing award paper[1] to ground a definition of FP, and he was specifically talking about an algebraic approach. This is something that seems to get overlooked when people talk about FP, but I believe it's even more important than, say, referential transparency. [1] https://amturing.acm.org/award_winners/backus_0703524.cfm https://amturing.acm.org/award_winners/backus_0703524.cfm then click on "ACM Turing Award Lecture" or just -> https://dl.acm.org/ft_gateway.cfm?id=1283933&type=pdf https://dl.acm.org/ft_gateway.cfm?id=1283933&type=pdf