3 ms·
Fully typed functional languages (Haskell for example) have this ability.
by simplecomplex 8y ago
Fully typed functional languages (Haskell for example) have this ability.
- dagenix 8y agoI'm not sure that is correct. A function that takes no arguments and returns 2 and a function that takes no arguments and returns 3 both have the same type signature. I'm not super strong on the theoretical side of computer science, but, my understanding is that the only general solution to determining if our function returns 2 or 3 (or some other integer) is equivalent to the halting problem.
- simplecomplex 8y agoYes, obviously. The API is the same though. The interface.
- dagenix 8y agoThe signature of the interface is the same, yes. But, if the behavior changes it can still break users. I'm fully in support of strong typing and SemVer and all that good stuff - I was just responding to your comment which I interpreted to mean that a language like Haskell has a full solution to the problem of breakage, which I don't believe it does. It's certainly in a better position that many other language in the types of breakage it can detect just from the function signatures, however.