3 ms·
Practically speaking, function calls over a network are by definition impure. Any function that is capable of returning varying results for the same arguments
by bunderbunder 12y ago
Practically speaking, function calls over a network are by definition impure.
Any function that is capable of returning varying results for the same arguments is impure. And a function call across the network could return anything - a correct response, a corrupt response, no response - depending on what the network's having for lunch at that moment. We do have clever tools like the I/O monad, yes. But the I/O monad doesn't take I/O and make it pure; it takes I/O and wraps it up in a clever facade that (usually) lets you pretend that it's pure.
- dragonwriter 12y agoWhether a function is logically pure or not precedes the decision to implement via a network call and, in the event that a pure function is for some reason implemented via a network call, shapes how you implement it as a network call (as it affects cacheability, etc.) Obviously, the medium of a network call is inherently impure -- but in the same way that anything implemented in an any physical device is (including internal computations in an electronic computer without network communication.)
- bunderbunder 12y agoTechnically, yes, you can follow that reductio all the way down the rabbit hole. Practically speaking, though, it's not generally considered problematic that there's no way to set a timeout before issuing the CALL instruction.
- dllthomas 12y agoThere are ways to set a timeout before issuing (a particular) CALL instruction. Occasionally these are important.