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: fromMaybe
Type: a -> Maybe a -> a
Description: If the argument is Just, it returns the Just value, otherwise it returns the default value provided as the first argument
Related: fromJust, mapMaybe, maybeToList

Example 1

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

Output: 'C'

Example 2

Input: fromMaybe 'X' (lookup 32 [(1,'A'),(2,'B'),(3,'C')])

Output: 'X'




_____________________________________________
Reference Search | Sitemap | XML Glossary       ZVON | Systinet




Related sites:
  • dotNet Slackers - Your latest resource for ASP.NET
  • Dotnet Spider - Outsourcing and Offshore software development in India
  • XML - Xselerator, XSL Editor, BizTalk Utilities, XML Tutorials, Learn XML
  • Planet Source Code - The largest public source code database on the Internet
Domain Names VoIP Internettelefonie DSL, SDSL, ADSL UNLIMITED Web Hosting by HostDepartment conference call service
answering service