ZVON > References > Haskell reference
| Indexes | Syntax | Prelude | Ratio | Complex | Numeric | Ix | Array | >> List << | Maybe | Char | Monad | IO | Directory | System | Time | Locale | CPUTime | Random

Module: List
Function: elemIndices
Type: Eq a => a -> [a] -> [Int]
Description: returns an in-order list of indices
Related: elemIndex, find, findIndex, findIndices

Example 1

Input: elemIndices 3 [1,2,3,4]

Output: [2]

Example 2

Input: elemIndices 3 [1,3,2,3,3,4,3]

Output: [1,3,4,6]

Example 3

Input: elemIndices 'a' "abbacca"

Output: [0,3,6]