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: | listToMaybe |
Type: | [a] -> Maybe a |
Description: | If the argument is an empty list, it returns Nothing, othervise it returns Just with the value of the first list item. |
Related: | maybeToList |
Input: listToMaybe [1,2,3,4]
Output: Just 1
Input: listToMaybe ""
Output: Nothing