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: 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

Example 1

Input: fromJust (lookup 3 [(1,'A'),(2,'B'),(3,'C')])

Output: 'C'

Example 2

Input: fromJust (lookup 31 [(1,'A'),(2,'B'),(3,'C')])

Output: Program error: Maybe.fromJust: Nothing