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: | fromJust |
Type: | Maybe a -> a |
Description: | If the argument is Just, it returns the Just value, otherwise an error is produced |
Related: | fromMaybe, mapMaybe, maybeToList |
Input: fromJust (lookup 3 [(1,'A'),(2,'B'),(3,'C')])
Output: 'C'
Input: fromJust (lookup 31 [(1,'A'),(2,'B'),(3,'C')])
Output: Program error: Maybe.fromJust: Nothing