idris-lang / Idris2

A purely functional programming language with first class types
https://idris-lang.org/
Other
2.46k stars 369 forks source link

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

Closed troiganto closed 4 weeks ago

troiganto commented 4 weeks ago

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?