News for hackers. Stuff that matters.
Re:Swift Functors, Applicatives, and Monads in Pictures by jameshart on Tuesday July 14, 2015 @06:43PM (#9888567)
The problem is that the category-theory view of functors and monads and monoids completely dominates the literature.

Imagine if, when you first started programming, and you wanted to do something with numbers, and you found out that in your programming language, the way you did that was to use something they called "Integers" (I know, right? ridiculous). So you google "Integers" and you find https://en.wikipedia.org/wiki/Integer, which helpfully tells you

"In elementary school teaching, integers are often intuitively defined as the disjoint union of the (positive) natural numbers, the singleton set whose only element is zero, and the negations of natural numbers."[1]

And you get the impression that to add a couple of numbers together you're actually going to have to understand cardinality and group theory and so on.

That's kind of where we are with monads, with the insistence on the academic language.

Though it does suggest that I could have fun by persuading beginning programmers that to really grok text processing they need to start off with a thorough grounding in string theory.

[1] I checked with my son, who goes to elementary school. I'm not sure he even knows what a disjoint union is. I'll have to have words with the teacher.

Re:Swift Functors, Applicatives, and Monads in Pictures by TillE on Tuesday July 14, 2015 @08:49PM (#9889075)
I'd forgotten how spectacularly academic Wikipedia's math articles are. It actually seems a little better than it used to be, but for example good luck learning what the hell a quaternion is by reading the Wikipedia article, even if you have sufficient background to understand and use them in practice. The German article is much better.
Re:Swift Functors, Applicatives, and Monads in Pictures by jameshart on Tuesday July 14, 2015 @09:04PM (#9889127)
Right. You don't want to try to learn something mathematical from the Wikipedia article on it - Quaternions are a great example. The trouble with most of the writing about monads is that it's all at the level of the opening paragraph of a Wikipedia math article.

We have to do better at finding a way to teach this stuff.

Re:Swift Functors, Applicatives, and Monads in Pictures by mdup on Wednesday July 15, 2015 @07:55AM (#9890819)
When I started using quaternions for rotations, which -- if we're honest -- is the #1 practical applications, I had much more success building my intuition around this Wikipedia section:

https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotati...

Re:Swift Functors, Applicatives, and Monads in Pictures by dragonwriter on Wednesday July 15, 2015 @12:29PM (#9892268)
> The trouble with most of the writing about monads is that it's all at the level of the opening paragraph of a Wikipedia math article.

IME, that's not at all true; most of the theory-heavy sources I've seen are explicitly framed as alternatives to the large body of intuitionist tutorials that avoid theory almost entirely, focusing on a few popular applications (usually, collections and IO.)

Re:Swift Functors, Applicatives, and Monads in Pictures by Ivanov on Tuesday July 14, 2015 @08:57PM (#9889102)
Being able to use something and knowing the whys are two different things. Many people know Calculus(practice), but not many know Real Analysis(theory behind Calculus, the academical bit).

"In mathematics, the quaternions are a number system that extends the complex numbers."

Naturals are a subset of integers. Integers are a subset of rationals. Rational are a subset of reals. Reals are a subset of complex numbers. The latter are a subset of quaternions. It's not difficult to construct each number system. If you look inside any undergrad math textbook, you'll find exact same writing style showcased in the Wikipedia article on quaternions.

Re:Swift Functors, Applicatives, and Monads in Pictures by LimpWristed on Tuesday July 14, 2015 @08:00PM (#9888923)
You're over-exaggerating :) From the wiki link, the very first definition works just fine. In fact, I don't see anything about unions, disjointedness in there. Certainly, no group theory. You don't need to know how to construct, count(cardinality) or know the properties of integers(number/group theory) to know what they are for the purposes of programming. No, there's no cabal making everything more difficult than it needs to be ;D I think wiki always gets unfairly maligned for this sort of thing.