Skip to content

Comment on Lens: Lenses, Folds and Traversalsparent

Comments

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.

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"

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.