Dear Father, forgive me, for I have sinned. I just tried to explain monads to someone on the Internet.
-
-
@wycats@steveklabnik@samth They should, yes. But after a lot of discussion TC39 decided to just go with the overloaded .then, which is sad -
@robotlolita@steveklabnik@samth that suggests they are used in a quite monadic way, whatever we decided. -
@robotlolita@steveklabnik@samth the exception is that you cannot have a Promise for a Promise, but that's it. -
@wycats@steveklabnik@samth And that is enough to make it not a monad. You can call it "monad-ish", but you lose the monad benefits -
@robotlolita@steveklabnik@samth you lose them for a subset of types, but retain them otherwise. -
@wycats@steveklabnik@samth sure, but that breaks e.g.: `sequenceM`, if you want to write it. The laws are important for abstraction/comp -
@robotlolita@steveklabnik@samth yes but there's a spectrum of "losing the benefits" -
@wycats@steveklabnik@samth in the case of monads, I'm not sure there are any benefits besides generic fns/composition, though. - 55 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.