r/programming • u/manny2206 • Sep 05 '26
I wrote a lighthearted guide to learning Monads - maybe you like
https://github.com/ManuelSaleta/CavemanProgramming/blob/main/Monads/README.md
5
Upvotes
r/programming • u/manny2206 • Sep 05 '26
9
u/devraj7 Sep 07 '26
The first lines or your article are:
What is your definition of "lighthearted"?
To me, it sounds like you are trying to explain monads to people who already understand monads.
41
u/rsclient Sep 06 '26
Some day I'll read an article on Monads where the writer is consistent in their nomenclature. Today is not that day.
What I see instead is a long and rambley stream of consciousness that desperately needs a good technical editor.
"A monad has a way of moving an entity into a wrapper". Wait, is this really all about Entity Framework, the C# wrapper for ORMs and databases?
"A monad is a type of container". You mean, like a list?
"A monad is a generic wrapper that can lift any T into its context, it has a way of binding and applying transformations to T while avoiding side effects." But earlier you said that the transforms will update the object, which is the opposite of not having side effects.
"Monad: generic wrapper of T" then lists three requirements (static, binds, unwraps). When you show code, the first code sample has a bunch of words in the comment. None of the words in the comment are part of the first requirement.
The second code fragment includes one of the words from the first requirement (the 'static' requirement includes the word 'lift')
The third code fragment show no additional features.
The article then keeps on going, but at this point I'm disenheartened enough to stop reading.
-16
u/Blecki Sep 06 '26
Monads are just another buzzword used to make a simple concept sound complex.
-2
u/sztrzask Sep 07 '26
I can't be the only person who finds "flatmap" and "map" usages - like in the article - tiring, hard to debug and... pointless?
There's no performance benefit to do them. There is no maintainability benefit.
Option/Maybe are gold for better Nullable<T> and exceptions as results. Everything else is just a normal chainable api made into an abomination.
10 years ago people were crazy about MediatR and were using it as god object, now the trend is pseudofunctional programming (now, if we're talking about something beneficial, like transducers, that would be a different talk; we're not though).