Re:Functors, Applicatives, and Monads
by jerf on Monday March 31, 2025 @10:55AM
(#43535755)
I prefer the "join" approach for beginners too, but >>= has become so pervasive that I feel bad trying to explain it that way. Turning people loose on monad-heavy code with that approach still leaves them needing to convert their understanding into >>= anyhow.
One does wonder about the alternate world where that was the primary way people interacted with it.
Re:Functors, Applicatives, and Monads
by _jackdk_ on Tuesday April 01, 2025 @03:39AM
(#43543923)
I think you don't have to teach people to program with `join`, but just that `m >>= f = join (fmap f) m`. It explains away the "get a value out" question but teaches the most common function from the interface.
One does wonder about the alternate world where that was the primary way people interacted with it.