1117
you are viewing a single comment's thread
view the rest of the comments
[-] david@feddit.uk 7 points 1 year ago

Don't call it a monad, call it a structured data type or something, that's what it is! Calling it a monad is like saying that you're using a curve of constant normal intersection point. Why not just say it's a wheel?

Yes, it's mathematically true that you're having a smooth ride precisely because the normals have a constant intersection point, but it's also true to say that it's a wheel and it goes round and isn't bumpy and doesn't scrape, and people can get a handle on that.

So yeah, use a Result or Option or Maybe structured data type because it keeps explicit track of whether there's a value or not, and yeah, you can change or combine them and preserve the tracking, but there's no point calling it a monad unless you're trying to make people believe that avoiding the $1bn mistake of allowing/using null requires category theory. It doesn't, it's just a structured data type. It's simpler than an array! Stop calling it a monad.

[-] Spzi@lemm.ee 3 points 1 year ago

"Monad" is a shorter term though. "Structured data type" reads almost as bulky as "Curve of constant normal intersection points".

[-] david@feddit.uk 3 points 11 months ago

True. But the word Monad has done more harm to the accessibility, popularity and reputation of pure functional programming than pretty much anything else.

Yeah, I could have said circle rather than curve of constant normal intersection points, but that word is very commonly understood, so it's not that same as unnecessarily calling something a Monad. Maybe it's the equivalent of calling it a 2-manifold instead of a wheel.

Perhaps just ditch the generalisation, then, and just call them Result or Maybe. After all, circle is a short word, but we just call them wheels.

this post was submitted on 05 Oct 2023
1117 points (97.0% liked)

Programmer Humor

32155 readers
212 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS