4 ms·
> the basic concept would work in a non-statically typed language, too How? How do I compare. say, two functions for equality, without comparing the return va
by marvy 11y ago
> the basic concept would work in a non-statically typed language, too
How? How do I compare. say, two functions for equality, without comparing the return value instead?
- eru 11y agoOh, I should have been more explicit: The decoupling of function calling and IO actions can work in non-statically typed languages, too. Your question concerns a different topic. To give something like an answer: that problem can only occur with `functions' of zero arguments. Haskell sidesteps the issue by requiring all functions to have exactly one argument.
- marvy 11y agoOkay, that's cheating. Or rather, that's fine for them, but is no help in porting this idea to Python, which definitely has functions of zero arguments, and they aren't even that rare. (Although comparing functions for equality is rare, but it should at least be possible.)