Top index Wirbel home

::forsome

forsome(acollection, function(tuple(A), boolean) predicate) - check if at at least one item of collection fullfills predicate

forsome(acollection, function(tuple(A), boolean) predicate) checks if at least one element of the string, list or set acollection fullfills predicate. predicate is a function that is called with an element and must return true or false. When the predicate is true for one of the members of the collection then forsome(acollection, function(tuple(A), boolean) predicate) returns true.

Examples

forsome("abcde", lambda x: x == 'c') == true
forsome([1,2,3,4,5], lambda x: x<1) == false

See also

forall