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

fix(base): runtime-erase implicit length argument to Vect's dropElem. #3301

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

troiganto
Copy link

Description

This makes it possible to call the function in more situations. It also brings its signature in line with the overloads on List, List1 and SnocList.

The previous implementation of Data.Vect.Elem.dropElem required the length of the Vect to be available at runtime. This was used in order to recurse in the case that the Elem is not Here. However, it turns out that this is not actually necessary. Idris can deduce that the tail must be non-empty if it contains an Elem.

Should this change go in the CHANGELOG?

  • If this is a fix, user-facing change, a compiler change, or a new paper implementation, I have updated CHANGELOG_NEXT.md (and potentially also CONTRIBUTORS.md).

This makes it possible to call the function in more situations. It also
brings its signature in line with the overloads on `List`, `List1` and
`SnocList`.

The previous implementation of `Data.Vect.Elem.dropElem` required the
length of the `Vect` to be available at runtime. This was used in order
to recurse in the case that the `Elem` is not `Here`. However, it turns
out that this is not actually necessary. Idris can deduce that the tail
must be non-empty if it contains an `Elem`.
@gallais gallais merged commit e0b9a02 into idris-lang:main Jun 5, 2024
22 checks passed
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

Successfully merging this pull request may close these issues.

2 participants