Monads aren’t nearly as complicated as people make it seem. It’s literally just a generic interface. Kind of like how you can have array.map, linkedList.map, or promise.map... all those types have a sort of common interface. Those are all “functors”. Monads are the same kind of thing, except in addition to map they have flatmap, which is basically just a different version of map which flattens nested results. This allows certain operations to be easily “chainable”. And that’s pretty much it.
Boom - monads!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Monads aren’t nearly as complicated as people make it seem. It’s literally just a generic interface. Kind of like how you can have
array.map
,linkedList.map
, orpromise.map
... all those types have a sort of common interface. Those are all “functors”. Monads are the same kind of thing, except in addition tomap
they haveflatmap
, which is basically just a different version ofmap
which flattens nested results. This allows certain operations to be easily “chainable”. And that’s pretty much it.Boom - monads!