The type signature of length returns an Int for a good reason and that is to ensure that any code using that function can rely on the result being an integral number. Logically speaking, lists can't contain a fractional number of elements, so this is probably not for historical reasons nor is it stupid. I think removing this sentence altogether would make more sense.
The type signature of
length
returns an Int for a good reason and that is to ensure that any code using that function can rely on the result being an integral number. Logically speaking, lists can't contain a fractional number of elements, so this is probably not for historical reasons nor is it stupid. I think removing this sentence altogether would make more sense.