3 ms·
> Monads solve problems that are only made apparent by other design decisions in Haskell. In a non-functional, loosely typed context they are not so useful. Th
by peteretep 7y ago
> Monads solve problems that are only made apparent by other design decisions in Haskell. In a non-functional, loosely typed context they are not so useful.
This is key. I've tried to write a "Monads in JavaScript" article many times over the years, but it's pointless, because you have to preface it with 100 imaginary constraints.
- platz 7y agoidk, rxjs, observables, and promises seem pretty popular. Doesn't mean it makes sense to try to write all your js code in an fp style though.
- AlexCoventry 7y agoSure they're popular, but the reason they don't talk about monads, even if they are monads in an abstract sense, is that in those problem domains the abstraction doesn't bring any clarity to the design.
- platz 7y agoWhether they talk about it or not, monads did inform their design. rxjs literally has methods named `flatmap`