3 ms·
Your first paragraph confuses me. Most APIs that I know for promises/futures are effectful. For example, there is a procedure for checking whether a promise h
by benjaminy 12y ago
Your first paragraph confuses me. Most APIs that I know for promises/futures are effectful. For example, there is a procedure for checking whether a promise has been fulfilled yet or not. The return value of this function obviously depends implicitly on the state of the promise object.
Making this abstraction purely functional requires making the interfaces of these API functions more complicated. And the monadic style helps reduce that complexity.
My point is that promises seem very much connected with effects to me, and I'm curious why you draw a line between them?
(I understand that there are implementations of the monad abstraction that are not connected with "state" in the conventional sense.)