elemIndices package:Stream

The elemIndices function extends elemIndex, by returning the indices of all elements equal to the query element, in ascending order. Beware: elemIndices x xs will diverge if any suffix of xs does not contain x.