Live data from Hacker News

Category Theory for Programmers (2014) [pdf]

github.com

91–100 of 136 posts

Re: Category Theory for Programmers (2014) [pdf]

#91

Earlier quoted context omitted.

> by carrying a "world" parameter that represents the state being modified From this, it's clear you've never read and understood Moggi's seminal paper. Monads are functors with some extra monoidal structure. The concept, and even Moggi's use of it in categorical semantics, has nothing to do with "worlds". The important realization is that there are many more monads than just the one hardcoded into one's programming…

Monads are still programmable semi-colons, though. Yes, there are a lot of things you can program into a line-end symbol. Yes, some of those things are general and work for any already modded semi-colon. But it's still just programmable semi-colons: implicit, uncomposable, and frankly better left alone.

> Monads are still programmable semi-colons, though

No, they’re not. That’s just an analogy that’s sometimes useful when describing them to imperative programmers to aid intuition.

Re: Category Theory for Programmers (2014) [pdf]

#92
post #89

Earlier quoted context omitted.

Monads are still programmable semi-colons, though. Yes, there are a lot of things you can program into a line-end symbol. Yes, some of those things are general and work for any already modded semi-colon. But it's still just programmable semi-colons: implicit, uncomposable, and frankly better left alone.

>implicit You'll have to elucidate, I don't follow. >uncomposable Demonstrably false, see monad transformers. >better left alone. "Yeah, well, that's just, like, your opinion."

Monad transformers are really not the great counterexample you seem to think they are.

Re: Category Theory for Programmers (2014) [pdf]

#93

Earlier quoted context omitted.

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…

>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.

Re: Category Theory for Programmers (2014) [pdf]

#94
post #84

Earlier quoted context omitted.

Apologies. I was on the phone typing the above. Still, remarks like "What?" that provide no information or context are against the rules on HN. Just FYI. The OP said that there's no point in labeling an arbitrary type as a functor or monadic value. I'm going to use an example to illustrate how there is a benefit in being aware of this concept. I will be using a "String Monad" in my example. Imagine you have some type…

So congratulations, category theory allowed you to come up with a solution which would make you immediately fail any reasonable job interview! Compared to the obvious answer your proposed approach is more code to write, orders of magnitude slower and has security as well as potential data corruption/robustness issues. Your gloss reveals further substantial misapprehensions about python basics (there are no regexps he…

Author mentioned elsehwere that he used that trick in postgresql , not in python, where it allowed him to skip SQL acrobatics and sped up query.

Re: Category Theory for Programmers (2014) [pdf]

#95
I wish some subjects of mathematics could be summarized in a TLDR fashion. It would make it much more interesting as an introduction.

I remember that we used to write very small sheets of formulas and other memos to condense a class into a much shorter thing.

Simple.wikipedia.org seems to somewhat be that.

I have always liked math, but I can see why people don't like math or get interested in math. The literature is exhaustive, unnecessary long, and just too arcane.

I will always be frustrated with the image of mathematics and how laymen often say "math is not for me", but sometimes I can understand why.

Re: Category Theory for Programmers (2014) [pdf]

#96
post #67

Earlier quoted context omitted.

One guy Eugenio Moggi saw that the category theoretical "monad" could formalize "imperative programming" in pure functional languages by carrying a "world" parameter that represents the state being modified. Since then people have been trying hard to jam the rest of category theory into programming hoping to uncover similarly striking results, to no avail.

> by carrying a "world" parameter that represents the state being modified From this, it's clear you've never read and understood Moggi's seminal paper. Monads are functors with some extra monoidal structure. The concept, and even Moggi's use of it in categorical semantics, has nothing to do with "worlds". The important realization is that there are many more monads than just the one hardcoded into one's programming…

Sorry for saying "world" and for underrepresenting Moggi's paper, but all those things you're mentioning are side effects and are captured by the same concept, of representing effects by carrying a parameter through a chain of function calls.

I'm not backing down from the core claim that Moggi realised that CT monads are a nice formalization of side effects in pure functional programming, and that this caused a flurry of interest in "what else" of high impact/interest CT can explain of programming, and that there isn't much else.

Re: Category Theory for Programmers (2014) [pdf]

#97

Can someone please explain to me the excitement for category theory in this forum? I've gone through the first 10 chapters + exercises of this book, and truth be told the content is interesting but the ROI is low for programming (FWIW I started this book as part of a study group in a large unicorn co, and after approximately one month I was the only person left grinding through the exercises, hoping for some payoff).…

I think it is a similar kind of excitement people have when learning Haskell and functional programming: pleasure to experience the aesthetics of pure forms, distilled mathematical concepts, that contrast with impurity and mess of real world coding.

I see some practical benefits from studying Category Theory and Pure Mathematics in general: mental patterns, some limited applications in general, interesting application in specific problems, but it requires huge investment of time, and, frankly, there are much more practical applied areas in maths that can bring food on the table: optimizations, probability, linear algebra, fluid dynamics, Fourier transforms.

One usually does not ask questions about applicability when decides to study Pure Maths, it is a passion driven adventure: https://en.m.wikipedia.org/wiki/A_Mathematician's_Apology

Re: Category Theory for Programmers (2014) [pdf]

#98
post #92
post #89

Earlier quoted context omitted.

>implicit You'll have to elucidate, I don't follow. >uncomposable Demonstrably false, see monad transformers. >better left alone. "Yeah, well, that's just, like, your opinion."

Monad transformers are really not the great counterexample you seem to think they are.

Monads were described as uncomposable. Monad transformers are one way they’re composed. I don’t understand your objection.

Re: Category Theory for Programmers (2014) [pdf]

#99

Can someone please explain to me the excitement for category theory in this forum? I've gone through the first 10 chapters + exercises of this book, and truth be told the content is interesting but the ROI is low for programming (FWIW I started this book as part of a study group in a large unicorn co, and after approximately one month I was the only person left grinding through the exercises, hoping for some payoff).…

Here’s maybe one attempt at answer https://blog.ploeh.dk/2017/10/04/from-design-patterns-to-cat...

As I take it the hope isn’t that all programmers would learn CT but rather that those who work on progressing the craft and our tools get at a proper formalism to work with for certain aspects that until now has been rather “soft”

Re: Category Theory for Programmers (2014) [pdf]

#100
post #60

Earlier quoted context omitted.

I think you may be missing something here. > The "theorems" they then prove do not provide any new insight Knowing that you can model reaction networks using categorical concepts may not provide new insights IF you have no deep familiarity with those concepts—but if you do, then knowing there is a "symmetric monoidal functor from the category Petri to the category Dynam" is a richly useful piece of information. It's…

> Knowing that you can model reaction networks using categorical concepts may not provide new insights IF you have no deep familiarity with those concepts—but if you do, then knowing there is a "symmetric monoidal functor from the category Petri to the category Dynam" is a richly useful piece of information. Look, I completely agree with the general point. I love new ways of thinking about things. But blindly applyin…

CT provides a language that allows us to talk about things without description of their inner workings. That allows us to see connections between seemingly different topics, which we wouldn't likely find within the domain specific language (DSL). DSLs have their purpose, but so has a meta language connecting DSLs.
Post reply on HN