Hacker News new | past | comments | ask | show | jobs | submit login

> Scala, Swift, and a number of other imperative languages have adopted monads (like Maybe) to great effect.

Much of the use of "monads" in many other languages -- and particularly all the examples here -- really rely only on that subset of monad functionality that defines applicative functors.

> Conversely, the state monad (for example) has seen less adoption.

The use of the state monad really relies on it being a monad and not a mere applicative functor; I'm not sure if that's related, but I think that applicative functors are an easier thing to wrap your head around than monads.




No. #and_then here is monadic bind (>>=), and is necessary for all three use cases he described - nested nil checks, nested iteration, nested IO actions/callbacks.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: