You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to #114 the behaviour of index for negative indices is not what I would expect from index. Instead of the behaviour of (!?) which returns nothing for out of bounds on either side, an out of bounds exception is thrown from from (!).
I would expect index to return Nothing even on input that is never valid for the underlying sequence. When I am using index in practice it is often to not have to care about the exact bounds myself, instead delegating that to the underlying sequence. So if exceptions occur or unreasonable results appear on unusual indices that benefit of using index disappears at least partly.
The text was updated successfully, but these errors were encountered:
Good catch, this is unintentional and simply some bad code. We should be returning Nothing in the case of negatives. Are you interested in PRing a fix?
Similar to #114 the behaviour of index for negative indices is not what I would expect from index. Instead of the behaviour of
(!?)
which returns nothing for out of bounds on either side, an out of bounds exception is thrown from from(!)
.I would expect index to return Nothing even on input that is never valid for the underlying sequence. When I am using index in practice it is often to not have to care about the exact bounds myself, instead delegating that to the underlying sequence. So if exceptions occur or unreasonable results appear on unusual indices that benefit of using index disappears at least partly.
The text was updated successfully, but these errors were encountered: