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

Module: Prelude
Operator: (!!)
Type: [a] -> Int -> a
Priority: 9
Description: accepts a list and an integer and returns the item in the list at integer position. The numbering starts with 0.
Related:
Keywords: array, index, list

Example 1

Input: [1,2,3] !! 0

Output: 1

Example 2

Input: [6,5,4,3,2,1] !! 2

Output: 4

Example 3

Input: "Hello" !! 1

Output: 'e'