(why) is there no Abstract Collection type

That section is confusing. A Tuple, or more generally any immutable “collection”, is not a collection by this definition (No method for empty!). So these methods don’t seem to capture the concept of a general collection… maybe an immutable collection.

At the bottom of that section is a list of types under “Fully implemented by”. The list includes several immutable types. You can check that empty! throws a MethodError as expected. So maybe “fully implemented by” refers only to the last function checked_length? The list of types is not in the same box as checked_length, so the formatting needs to change if this is the case. But there is a method Base.checked_length(r) = length(r). So everything that implements length also implements checked_length. So it doesn’t make sense that “fully implmented…” refers only to checked_length. (well, you could opt out by explicitly throwing a MethodError, which is sometimes done.).

At a minimum this section should be clarified.
EDIT: Opened issue 47456

2 Likes