2 ms·
I don't regret learning how monads work, on the type-theoretic level. With that, it becomes very clear what things like null / None and operations like foo?.bar
by nine_k 2y ago
I don't regret learning how monads work, on the type-theoretic level. With that, it becomes very clear what things like null / None and operations like foo?.bar actually try to represent, or what transformations you can expect to work on various collections (like map() and flatmap() or filter()), how futures and promises work and how to easily combine them (and why JS promises are almost but not exactly monads, and where it matters), and, for bonus points, what does the "semicolon operator", that is, statement sequence, does from the logical point of view.
Understanding how state and IO can be represented as monads, and thus what useState() and useEffect() do in React, was also a nice consequence.
But certainly you are free to dismiss this piece of theory, and think about all these things as separate and peculiar. It usually very well suffices