2 ms·
Simply a way to insert a converter function between each stage in a good-old-fashioned pipeline Yes, but more general. Some monad tutorials describe them as "o
by chongli 7y ago
Simply a way to insert a converter function between each stage in a good-old-fashioned pipeline
Yes, but more general. Some monad tutorials describe them as "overloading the semicolon." I felt I didn't really understand them until I got the idea of computations as values.
It's much harder to motivate monads in a dynamic language. They were invented to solve problems in Haskell and it is there where they truly shine. Having said that, most of their thunder has been stolen by applicative functors (which generalize monads) these days.