ZVON > References > Haskell reference |
Intro / Search / ZVON |
| Indexes | Syntax | Prelude | Ratio | Complex | Numeric | Ix | Array | >> List << | Maybe | Char | Monad | IO | Directory | System | Time | Locale | CPUTime | Random |
Module: | List |
---|---|
Function: | findIndices |
Type: | (a -> Bool) -> [a] -> [Int] |
Description: | Function find returns the first element of a list that satisfies a predicate, or Nothing, if there is no such element. findIndex returns the corresponding index. findIndices returns a list of all such indices. |
Related: | elemIndex, elemIndices, find, findIndex |
Input: findIndices (>3) [0,2,4,6,8]
Output: [2,3,4]
Input: findIndices (==3) [0,2,4,6,8]
Output: []
Input: findIndices even [2,4,6,8]
Output: [0,1,2,3]
Input: findIndices (\x -> 5**x > 10000) [2,4,6,8]
Output: [2,3]