Dear Father, forgive me, for I have sinned. I just tried to explain monads to someone on the Internet.
@robotlolita @steveklabnik What do you mean by "used as monads"?
-
-
@wycats@steveklabnik people don't define flatMap/join/unit on them and use those operations when working with them. -
@robotlolita@steveklabnik they are required to have those names? -
@wycats@steveklabnik No. They're only required to have equivalent types and follow the monadic laws. Which none of those examples do. -
@robotlolita@steveklabnik promises are so close to monads, and used that way, that@samth felt strongly they should just BE 100% monadic -
@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 - 59 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.