4 ms·
The 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
by lkitching 10y ago
The 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.