idris-lang / Idris2

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

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

Closed troiganto closed 5 months ago

troiganto commented 5 months 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?