ZVON > References > Haskell reference
| Indexes | Syntax | Prelude | Ratio | Complex | Numeric | Ix | Array | >> List << | Maybe | Char | Monad | IO | Directory | System | Time | Locale | CPUTime | Random

Module: List
Function: findIndex
Type: (a -> Bool) -> [a] -> Maybe Int
Description: Function find returns the first element of a list that satisfies a predicate, or Nothing, if there is no such element. findIndex returns the corresponding index. findIndices returns a list of all such indices.
Related: elemIndex, elemIndices, find, findIndices

Example 1

Input: findIndex (>3) [0,2,4,6,8]

Output: Just 2

Example 2

Input: findIndex (==3) [0,2,4,6,8]

Output: Nothing

Example 3

Input: findIndex even [2,4,6,8]

Output: Just 0

Example 4

Input: findIndex (\x -> 5**x > 10000) [2,4,6,8]

Output: Just 2




_____________________________________________
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