Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid requirements for insert in the documentation #466

Open
vinipsmaker opened this issue May 23, 2020 · 0 comments
Open

Invalid requirements for insert in the documentation #466

vinipsmaker opened this issue May 23, 2020 · 0 comments

Comments

@vinipsmaker
Copy link

Documentation states:

it must also be true that n < length(xs)

So if I have a sequence of size 2, the only valid indexes are 0 and 1 then I wouldn't be able to insert a new element at all valid places. Insert means insert before, so it should be valid to insert before the end iterator (i.e. length(xs)) and the actual requirement should be:

it must also be true that n <= length(xs)

I haven't fully tested, but the compiler accepts n=length(xs), so for now I'm assuming that only the documentation is outdated.

Thank you for the excellent library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant