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: maybe
Type: a -> (b -> a) -> Maybe b -> a
Description:
Related:

Example 1

Input: maybe 5 negate (lookup 1 [(1,10),(2,20)])

Output: -10

Example 2

Input: maybe 5 negate (lookup 9 [(1,10),(2,20)])

Output: 5