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: foldl1
Type: (a -> a -> a) -> [a] -> a
Description: it takes the first 2 items of the list and applies the function to them, then feeds the function with this result and the third argument and so on. See scanl1 for intermediate results.
Related: foldl, foldr, foldr1, scanl, scanl1, scanr, scanr1

Example 1

Input: foldl1 (+) [1,2,3,4]

Output: 10

Example 2

Input: foldl1 (/) [64,4,2,8]

Output: 1.0

Example 3

Input: foldl1 (/) [12]

Output: 12.0

Example 4

Input: foldl1 (&&) [1>2,3>2,5==5]

Output: False

Example 5

Input: foldl1 max [3,6,12,4,55,11]

Output: 55

Example 6

Input: foldl1 (\x y -> (x+y)/2) [3,5,10,5]

Output: 6.0




_____________________________________________
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