3 ms·
I think it's because they weren't very clear on how they wanted to handle partial functions / error reporting, and historically functions like head are partial.
by masklinn 8y ago
I think it's because they weren't very clear on how they wanted to handle partial functions / error reporting, and historically functions like head are partial.
Making them total makes them a bit heavier for the best case, and furthermore can seem unnecessary (as you could just pattern-match the list itself).
You can also see this oddity in Haskell allowing non-exhaustive case, and allowing refutable patterns in bindings.