File: exists.doc

package info (click to toggle)
hol-light 20120602-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 23,452 kB
  • sloc: ml: 348,797; cpp: 438; java: 279; makefile: 252; sh: 183; yacc: 108; perl: 78; ansic: 57; sed: 39
file content (29 lines) | stat: -rw-r--r-- 568 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
\DOC exists

\TYPE {exists : ('a -> bool) -> 'a list -> bool}

\SYNOPSIS
Tests a list to see if some element satisfy a predicate.

\KEYWORDS
list.

\DESCRIBE
{exists p [x1;...;xn]} returns {true} if {(p xi)} is true for some {xi} in the
list. Otherwise, for example if the list is empty, it returns {false}. 

\FAILURE
Never fails.

\EXAMPLE
{
  # exists (fun n -> n mod 2 = 0) [2;3;5;7;11;13;17];;
  val it : bool = true
  # exists (fun n -> n mod 2 = 0) [3;5;7;9;11;13;15];;
  val it : bool = false
}

\SEEALSO
find, forall, tryfind, mem, assoc, rev_assoc.

\ENDDOC