This assumes that `eltype` exists, which may not be true for iterables.