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: | Maybe |
---|---|
Function: | mapMaybe |
Type: | (a -> Maybe b) -> [a] -> [b] |
Description: | |
Related: | fromJust, fromMaybe, maybeToList |
Input: mapMaybe (`lookup` [(1,11),(2,22),(3,33)]) [1,2,11]
Output: [11,22]
Input: mapMaybe (`lookup` [('a',"AAA"),('b',"BBB"),('c',"CCC")]) "acfg"
Output: ["AAA","CCC"]