elemIndices -package:unboxing-vector -package:pipes-bytestring -package:bytestring package:rio

O(n) The elemIndices function extends elemIndex, by returning the indices of all elements equal to the query element, in ascending order. This implementation uses memchr(3).
O(n) The elemIndices function extends elemIndex, by returning the indices of all elements equal to the query element, in ascending order. This implementation uses memchr(3).
The elemIndices function extends elemIndex, by returning the indices of all elements equal to the query element, in ascending order.

Examples

>>> elemIndices 'o' "Hello World"
[4,7]
>>> elemIndices 1 [1, 2, 3, 1, 2, 3]
[0,3]
elemIndicesL finds the indices of the specified element, from left to right (i.e. in ascending order).
elemIndicesR finds the indices of the specified element, from right to left (i.e. in descending order).