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
Function: lookup
Type: Eq a => a -> [(a,b)] -> Maybe b
Description:
Related:

Example 1

Input: lookup 'c' [('a',0),('b',1),('c',2)]

Output: Just 2

Example 2

Input: lookup 'c' [('a',0),('b',1),('c',2),('a',3),('b',4),('c',5)]

Output: Just 2

Example 3

Input: lookup 'f' [('a',0),('b',1),('c',2)]

Output: Nothing