3 ms·
Strict typing eliminates some run-time bugs but not all of them. You can type "tail []" in any Haskell interpreter and see what's going to happen. Also there ar
by pandaman 10y ago
Strict typing eliminates some run-time bugs but not all of them. You can type "tail []" in any Haskell interpreter and see what's going to happen. Also there are logical bugs, which won't go away. For example you typed '-' instead of '+' somewhere. Type system won't care since both operators are the same type but suddenly you get a bug report that the player character in a videogame sometimes shoves his gun up his ass instead of holstering it.
- lkitching 10y agoThe behaviour of 'tail []' is not a failure of static typing but of the specified type of tail. tail is partial but fails to represent that in its type when it could easily do so. Changing it to List a -> Maybe (List a) would be more accurate, albeit possibly a little more confusing for beginners.
- pandaman 10y agoI agree. The point is that Haskell still throws run-time exceptions.