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: map
Type: (a -> b) -> [a] -> [b]
Description: returns a list constructed by appling a function (the first argument) to all items in a list passed as the second argument
Related:
Keywords: list calculation, list construction

Example 1

Input: map abs [-1,-3,4,-12]

Output: [1,3,4,12]

Example 2

Input: map reverse ["abc","cda","1234"]

Output: ["cba","adc","4321"]

Example 3

Input: map (3*) [1,2,3,4]

Output: [3,6,9,12]

Example 4

Input: map (recip . negate) [1,4,-5,0.1]

Output: [-1.0,-0.25,0.2,-10.0]

Example 5

Input: map (print) [1,3,5,6,7]

Output: [<<IO action>>,<<IO action>>,<<IO action>>,<<IO action>>,<<IO action>>]




_____________________________________________
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
answering service water softener MSN Alojamiento Web UNLIMITED Web Hosting by HostDepartment
VoIP Internettelefonie Hosted Exchange, SDSL VoIP Internettelefonie AT VoIP Internettelefonie DE