3 ms·
A monad in Swift terms is essentially just a container type with an initializer that lets you put something in it, and implements flatMap. In Haskell, the equiv
by cballard 11y ago
A monad in Swift terms is essentially just a container type with an initializer that lets you put something in it, and implements flatMap. In Haskell, the equivalents are return and >>=. You can do more with it in Haskell because Monad is essentially a protocol, so you can rely on monadic types having those functions defined in terms of them.
Array and Optional are examples. RAC's SignalProducer is... maybe one? Maybe three?
That's really all there is.