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

Module: Array
Function: indices
Type: Ix a => Array a b -> [a]
Description: The functions indices, elems, and assocs, when applied to an array, return lists of the indices, elements, or associations, respectively, in index order.
Related: assocs, bounds, elems

Example 1

Input: indices (array (0,3) [(1,"A"),(2,"B"),(3,"D"),(0,"QQQ")])

Output: [0,1,2,3]

Example 2

Input: indices (array (0,3) [(2,"B")])

Output: [0,1,2,3]

Example 3

Input: indices (array (3,5) [])

Output: [3,4,5]