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

Module: Maybe
Function: mapMaybe
Type: (a -> Maybe b) -> [a] -> [b]
Description:
Related: fromJust, fromMaybe, maybeToList

Example 1

Input: mapMaybe (`lookup` [(1,11),(2,22),(3,33)]) [1,2,11]

Output: [11,22]

Example 2

Input: mapMaybe (`lookup` [('a',"AAA"),('b',"BBB"),('c',"CCC")]) "acfg"

Output: ["AAA","CCC"]