
On Wed, Aug 13, 2014 at 3:06 PM, Ben Millwood
`length :: [a] -> Word` (or things of that ilk) would be even more of a mistake, because type inference will spread that `Word` everywhere, and `2 - 3 :: Word` is catastrophically wrong.
This is a pretty convincing argument for me. I have in the past used Word for things that seemed like they should always be positive, and pretty quickly reverted back to a signed type. All you need is a subtraction anywhere and the chance of underflow is very high. And, as Ben said, it's easy for the "always positive" type to wind up in a domain where subtraction is valid due to type inference. The principled thing might be to make that a different type, but in practice that can be a lot of hassle so it often doesn't happen (do you use NonEmpty everywhere possible? always have separate types for absolute and relative measures? sometimes it's not worth the clutter).