3 ms·
OT: Isn't passing an object around that defines a series of callbacks to be applied essentially a... monad?
by hcarvalhoalves 13y ago
OT: Isn't passing an object around that defines a series of callbacks to be applied essentially a... monad?
- jerf 13y agoNo. There's too many differences in all sorts of directions for this to be a useful way of approaching them.
- hcarvalhoalves 13y agoRight, I'm stretching. For a moment I had a glimpse of it being the same design pattern, since Deferreds are composable.
- noelwelsh 13y agoYes, futures/promises/whatever-you-want-to-call-them are monads in Scala and Haskell. The interface to these Deferreds are not, but it would be quite simple to make them so.
- voyou 13y agoYes: here's an interesting discussion of promises (in JavaScript) in terms of monads: http://blog.jcoglan.com/2011/03/11/promises-are-the-monad-of-asynchronous-programming/ http://blog.jcoglan.com/2011/03/11/promises-are-the-monad-of...