nevalang/neva

`Index` flow has a generic signature that doesn't make sense.

Catya3 opened this issue · 0 comments

The Index flow has a generic signature that doesn't make sense.

// Index returns the element at the given index in the ordered collection.
// If the index is out of bounds, it returns an error.
// The index is zero-based.
#extern(index)
pub flow Index<T list<any> | string>(data T, idx int) (res T, err error)

We would expect res to have the element type but instead it's a list<any>.

We may wish to separate this into strings.Index and lists.Index until/if we can more precisely capture this.

I have lists.Index under the name lists.At in #679