Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I liked “An Invitation to Applied Category Theory“, pdf is available here: [1]

It is written in a more terse, mathematical language, but it is very clear and friendly for non-mathematicians. The authors provide interesting examples of applicability. Hardcover is quite expensive, but the quality is great [2].

[1] http://math.mit.edu/~dspivak/teaching/sp18/7Sketches.pdf

[2] https://www.amazon.com/gp/aw/d/1108482295



If you're interested in going through "Seven Sketches", John Baez taught an online category theory course in 2018, with "Seven Sketches" as the text. Check out past lectures (and student discussion) here:

https://forum.azimuthproject.org/categories/applied-category...


This is awesome, holy crap, thank you so much.

For anyone else wanting some video, here's a link to youtube channel for some of the lectures: https://www.youtube.com/channel/UCUQlS-R4O094jP0sGHDnrjA


I've quite literally spent the last month trying to read, digest, and apply the above to a record layer I'm writing for FoundationDB. Dr. Spivak's work has been absolutely beyond helpful and insightful. There's no way I'd even be able to approach the subject with his efforts.

I'd also recommend these as they're associated with the 7 Sketches and help fill in some blanks:

Functorial Data Migration - https://arxiv.org/pdf/1009.1166.pdf

Category Theory as a Unifying Database Formalism - https://arxiv.org/pdf/1009.1166.pdf

Database Queries and Constraints via Lifting Problems - http://math.mit.edu/~dspivak/informatics/LiftingProblems.pdf

Additionally, there's also https://www.categoricaldata.net/ which helps provide more actualized implementation details of "FQL" (Functional Query Language) which he mentions in his papers.

For anyone else looking to get started with Category Theory, I'd also highly recommend choosing a functional library (i.e. something with Applicative, Functor, Category, Monad, Semigroup, Semgroupoid, Comonad, etc) in whatever language you're most familiar with and then _re-implement_ the functions to learn what it's doing (and what properties each class of item must conform to). In Elixir, I've been using Witchcraft... github.com/witchcrafters/witchcraft

For me, it has helped a great deal by forcing me to think about things like associativity, identity, and composition which I normally... didn't really do. It lends some nice patterns and naming conventions, even if you don't adhere to them perfectly. After a month of category theory, and only a crude/rudimentary understanding of it, has been enormously beneficial. My refactor of my FDB record layer after category theory has less code, works more correctly, and has more features. It's crazy...

Category theory gets 10/10 from me.

P.S. You'll probably, at some point, want to learn a little Haskell to help elucidate things in a "pure" context. It also helps as most every functional library is modeled after Haskell's standard library (? I'm still new, heh). To get started, this will save you time, as it seems most things in the Haskell world now-a-days be using this to setup/manage applications: https://docs.haskellstack.org/en/stable/README/


Since you sound like you're from the category theory community you may already know this, but my database library Opaleye is directly based on David Spivak's ideas.

https://hackage.haskell.org/package/opaleye


I'm totally new to the community! So I have no idea about almost anything I didn't link to or isn't linked here, ha.

That is a freakin' awesome link, thank you so much! Though, it'll probably mean yet another rewrite of my record layer :) (at learning is fun)


Feel free to email me if you have any questions around Haskell/category theory/databases. My email address is linked in the Opaleye README.

(BTW I meant "sounds like you're from the Haskell community" ... thinko)


Thank you for sharing your experience!

I think of Category theory and Abstract algebra as great upgrade kits for brain. If, say, a software engineer manages to learn, understand, and internalise those fields up to some level, she will be able to see her daily work - algorithms, architecture, approaches to solve problems - through the mental models those areas of mathematics imprinted into her brain, think and express solutions in those categories. May feel a bit like a superpower :)


You linked to the 1166.pdf twice, did you mean to link to http://math.mit.edu/~dspivak/informatics/notes/unorganized/P... for "Category Theory as Unifying Database Formalism"?


Totally! Thank you for providing the correct link, I had to step out for dinner and didnt see the screw up until now.


Thanks for this, super interesting. Your second link is repeated though, I assume it should be this: https://math.mit.edu/~dspivak/informatics/notes/unorganized/...


Another interesting one about databases and category theory: Relational algebra by way of adjunctions: https://dl.acm.org/citation.cfm?id=3236781


is the source code of the record layer available somewhere?


It will be in the next few days, I've been in a long sprint to get everything I've been working on done (and my personal website online); so, I can have an online portfolio and apply for jobs again (yay, ~f~unemployment).

It's totally not compatible with Apple's record layer I don't use protobufs at all (though there's a good case to be made for using them even despite the article from today's frontpage, heh).


This is probably one of the best introduction to category theory text out there now, but it isn’t exactly as friendly to the non-mathematicians as advertised. The book assumes a level of mathematical sophistication beyond what most non-math majors know and ramps up fast. The average programmer would probably get lost pretty quickly with this book.


>but it isn’t exactly as friendly to the non-mathematicians as advertised.

i really chafe at criticisms like this given how much effort was clearly invested by those authors in that book being readable - there are ample definitions (and clearly offset), tons of diagrams, instructive examples, solutions to many exercises, pointers to further readings, motivation and discussion.

is the thing that bothers you that there's formal mathematics? it's a math book. i feel like your same criticism translated into a criticism about a programming book would be something like "this book is too unfriendly to people that don't program because it has lots of code and expects people to be able to read code".

i don't understand what exactly would qualify for you as "friendly"?

>category theory for the average programmer.

that's because despite what people would have you believe - category theory isn't for programmers but mathematicians. so a book like that would be like a book about fluid dynamics for plumbers (read: impossible).


>is the thing that bothers you that there's formal mathematics

No. I like formal mathematics.

The audience of this book includes “motivated high school student who hasn’t seen calculus yet“.

IMO the book fails here. The average high schooler won’t understand this book on their own. This book is excellent if you already have an understanding of abstract algebra or higher level mathematics though, which is why I said it’s probably one of the best introduction to Category theory text out there. The topics covered in this book are great. This is a really outstanding book.


compare

>The average high schooler

with

>motivated high school student

certainly we all underestimate the difficulty of material (obverse of the dunning-krueger effect) but it says it does at least hint at it right there.

but honestly i'm curious where in the book you see an example of a term or notion that isn't defined in situ? as usual (with all of these things) mathematical maturity is what's required rather than familiarity with the material. what this means is a sense for why definitions are written in the way that they are, which hypotheses in theorems capture the phenomenon and which are technical, which lemmata can be ignored on first reading, etc. this is a very hard thing to communicate, especially in text, but this book does do its best to make that not-overwhelming as possible with ample restatements of definitions and assumptions and diagrams.


> "this book is too unfriendly to people that don't program because it has lots of code and expects people to be able to read code"

That would be a perfectly valid response to the claim that the book "is very clear and friendly for non-coders". I don't understand why you are chafed.


what kind of book that teaches programming could possibly have no code in it? that's not just "friendly" that's completely completely lacking substance.


I imagine everyone agrees with you on that. You responded to an objection to a characterization of the book, not a criticism of the book for failing to match that characterization nor a claim that a book on the topic should be able to match it.


you're not getting me

>That would be a perfectly valid response to the claim that the book "is very clear and friendly for non-coders".

no it wouldn't because it would be vacuously misplaced because there is no such book that aims to teach programming (friendly or not) and doesn't have code.


I am absolutely getting you. The person you responded to did not make the claim that such a book exists. He challenged the idea that the book in question is an example of such a book.


Is it possible to write such a book? I've served as the (non-mathematician) outside chair on committees for category theory dissertations, and the mathematicians themselves talk about whether category theory is too abstract. I can't really tell, of course, because my main role is to not fall asleep during the defense of any math dissertation.


Thanks for the feedback.

I’d like to elaborate on “friendly to non-mathematician”. The book is written for non-mathematicians with the focus on applications, and, like throwlaplace noticed in their comment, they put a lot of effort to explain the subject for the target auditory: diagrams, pictures, explanations, few proofs.

But, after all, it is a maths book on a highly abstract topic, therefore the reader should have some previous exposure to maths and mathematical texts, and expect to struggle, from the very first pages.

I think it is impossible to teach category theory to a person who does not have some basic knowledge in undergraduate maths, better in abstract algebra.


>The audience for this book is quite diverse: anyone who finds the above description intriguing. This could include a motivated high school student who hasn’t seen calculus yet but has loved reading a weird book on mathematical logic they found at the library. Or a machine-learning researcher who wants to understand what vector spaces, design theory, and dynamical systems could possibly have in common. Or a pure mathematician who wants to imagine what sorts of applications their work might have. Or a recently-retired programmer who’s always had an eerie feeling that category theory is what they’ve been looking for to tie it all together, but who’s found the usual books on the subject impenetrable.

Gives the idea this text should be accessible to those that haven’t seen calculus yet, presumably that would also mean those that haven’t had abstract algebra either. But in reality this book is more advanced than what the average retired programmer or average high schooler could understand on their own. It’s better suited for those that already are familiar with more advanced mathematics. I am not knocking the book. As mentioned, it is probably one of the best introductory books on Category theory currently out there.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: