Hacker News new | ask | show | jobs
by KPGv2 349 days ago
A monad is just a flatmappable. The end. That's the whole tutorial. If you're coming from JS/TS and know how to construct a singleton array and can use Array.prototype.flatMap, you already can do monads. Anything else "monadic" is not a monad. It's a property of something else that can be derived from what I wrote above, OR it's a property of one specific monad not monads in general.

A monad is a flatmappable.

A monad is a flatmappable.

A monad is a flatmappable.

1 comments

It doesn't cover monad transformers though.
Why would a definition of a monad need to define "monad transformer"? THat's like saying "your definition of "class" needs to cover "object mapper"