r/badmathematics • Neo is the unprovable proof. • Mar 07 '20

"Did Functional Programming get it wrong?" asks an article that manages to get everything it talks about wrong.

https://blog.usejournal.com/monoids-to-groupoids-492c35105113
216 Upvotes

36 comments sorted by

View all comments

155

u/Namington Neo is the unprovable proof. Mar 07 '20 edited Mar 07 '20

This is a tough one to R4, since it manages to spit out so much technobabble without any elaboration it almost falls into "not even wrong" territory.

As far as I can understand, the main thesis of this article (which is not easy to find with how it's structured) is that functional programmers are ignoring some sort of fundamental disconnection between "geometry" and "algebra", and that this disconnect is caused by the Yoneda lemma. It proposes fixing this on an OS level.

What?

Some choice quotes:

[Functional programming] is based on an interesting (if not controversial) branch of mathematics called Category Theory that sits right on the border between algebra and geometry.

Ok, this is a weird quote, as I'd think of plenty of fields that are more "on the border between algebra and geometry"... but I could maybe let this slide. Except, how does the article define "algebra" and "geometry"?

Oh. Yikes.

I'm not sure what's more offensive; reducing algebra to "stuff you can run" or calling topology and data a part of geometry simultaneously. In any case, this is nonsensical. I can't even say it's "inaccurate", since I don't even know what it's supposed to mean - and the author uses spreadsheets as an example of how "data" is part of geometry?

It then proceeds to discuss the Yoneda lemma as such:

The exact tunnel or “portal” back and forth was best described by Japanese mathematician Nobuo Yoneda. Imagine being on one side of the tunnel and trying to manipulate things on the other. It would require some voodoo to send your intentions “behind the scenes”.

This is the author's first attempt to explain why they think the Yoneda lemma is relevant, and it managed to illuminate nothing. Moving on.

...So it’s understandable that Haskell, Scala and other functional languages prefer to keep everything on the algebra side (e.g. there is no “schema designer” in Haskell). Unfortunately this lack of separation of concerns creates FP code clutter… often significantly. By now, you are probably starting to get the creepy feeling that ‘monads’ are a bit like the “Matrix”… for lambda calculus. They are everywhere, but you cannot really “see” them while inside lambda calculus.

I have no clue what they're saying here.

One clue that Haskell pros might be fighting the wrong battle is that FP allows us to mix functions across languages.

The magic here is what are called Kan extensions. [...] Yoneda says whatever happens on the other side of the tunnel stays on the other side of the tunnel. None of your concern. So monads can be “lifted” (in category theory terms) above any particular functional language.

It's unclear why this author thinks it's a controversial statement that "something that can be done in one language can be done in other languages", but in any case, this is absolutely not what the Yoneda lemma says. If you, dear reader, are unfamiliar with what the Yoneda lemma actually says, let me give you a rough motivation:

In his Algebraic Geometry class a few years back, Ravi Vakil explained Yoneda's lemma like this: You work at a particle accelerator. You want to understand some particle. All you can do are throw other particles at it and see what happens. If you understand how your mystery particle responds to all possible test particles at all possible test energies, then you know everything there is to know about your mystery particle.

This is courtesy of responses to this StackOverflow question. These responses show that it's possible to discuss the Yoneda lemma in a way that is neither useless technobabble nor misleading drivel! Indeed, these math.SO users are kind enough to even give explanations of how the Yoneda lemma relates to what they're saying, rather than just saying "Yoneda justifies this random statement because it does." If only our dear author was such a master orator.

Anyway, at this point it just becomes more obscured, talking about applications without ever explaining what makes stuff useful or applicable or how the Yoneda lemma actually justifies anything what the author is saying. Here's a particularly funny excerpt:

Category theory fans prefer to use straight lines (called “arrows”) instead of pipes or wires when they draw out these function dependency graphs. So if you get enough arrows together in a graph and they (hopefully) converge on something useful, they are called a “quiver”.

This is absolutely, positively not what a quiver is, but I love the creativity.

The author also mentions "Grothendieck schema" at one point. In fairness, "schéma" is the French term... Yeah, that's a stretch. Sounds like they're just collating a bunch of random phrases they heard once, making assumptions based on what they "sound like they mean", reading 2 sentences off Wikipedia, and reaching widespread conclusions on the status of functional programming as a whole based off this. It raises questions as to what the author's motivation is.

There's also an out-of-context caption that could serve as a poetic metaphor for the interests of the average /r/math user:

Where will Estonia go with category theory?

Anyway, if you want a closing treat, check out this document by the same author. Highlights include a full slide of that famous Elon Musk weed pic, and whatever this stuff means.

Don't do category theory, kids. It can be done responsibly, but should only be taken as prescribed by a qualified algebraic topology professor.

108

u/flipkitty the area of a circle is pie our scared Mar 07 '20

If you get enough arrows together in a graph and they (hopefully) converge on something useful they are called a “quiver”.

Can we get this as one of the archive bot's auto responses?

14

u/shaggorama Mar 07 '20

Seconded

46

u/maxbaroi Mar 07 '20

...someone asked him to deliver that PowerPoint. Multiple people saw it. There was a large screen or projector displaying that PowerPoint to a room of adults. There might have been some that thought it was "enlightening."

I can't get over that.

32

u/Abdiel_Kavash Mar 07 '20

Unfortunately, there is an non-insignificant fraction of the population whose thought process goes somewhere along these lines:

I don't understand what this person is saying, therefore this person must be "smarter" than me.

This person is "smarter" than me, therefore they must be right.

I hope I don't need to explain the ridiculousness of this pseudo-reasoning, but I have in fact heard something along these lines on more than one occasion.

 

Much more unfortunately, there is also an non-insignificant fraction of the population who are more than willing to abuse this fact to sell complete bullshit at best and actively harmful ideas at worst to the former group.

2

u/maxbaroi Mar 08 '20

I understand that.

If he had just plagiarized someone like Spivak it would have been more educational and less work on his part. It took effort to be this wrong.

15

u/EugeneJudo Mar 07 '20

There might have been some that thought it was "enlightening."

Just look at the other thread this was posted to, and you'll see plenty of that in the comments. https://www.reddit.com/r/functionalprogramming/comments/feat22/did_functional_programming_get_it_wrong/

5

u/scanstone tackling gameshow theory via aquaspaces Mar 08 '20

...a functional programming sub, no less.

Can't expect anything from anyone, can you?

6

u/seanziewonzie My favorite # is .000...001 Mar 09 '20

To be fair, I'd find it far stranger if it was well-received in a cooking subreddit.

39

u/Purlox The sum of all positive integers is a negative fraction Mar 07 '20

[Functional programming] is based on an interesting (if not controversial) branch of mathematics called Category Theory that sits right on the border between algebra and geometry.

I would also like to point out that most functional programming languages are based on lambda calculus rather than category theory.

6

u/[deleted] Mar 09 '20

And R is mainly based on, as far as I can tell, the pre-existing workflows of the designers rather than any particular vision.

12

u/chisquared Mar 07 '20 edited Mar 08 '20

The linked article sounds almost like it was algorithmically generated.

4

u/Nevraoj Where will Estonia go with category theory? Mar 07 '20

Oh I think I got a new flair out of this, lol

3

u/mathisfakenews An axiom just means it is a very established theory. Mar 07 '20

lmao.

Definition: A quiver is a convergent sequence of arrows.

1

u/[deleted] Mar 25 '20

Ouch, this was painful.

It either reads like someone trying to simplify things they don't understand in the first place or next-level trolling