any -package:relude package:base

Determines whether any element of the structure satisfies the predicate.

Examples

Basic usage:
>>> any (> 3) []
False
>>> any (> 3) [1,2]
False
>>> any (> 3) [1,2,3,4,5]
True
>>> any (> 3) [1..]
True
>>> any (> 3) [0, -1..]
* Hangs forever *
Applied to a predicate and a list, any determines if any element of the list satisfies the predicate. For the result to be False, the list must be finite; True, however, results from a True value for the predicate applied to an element at a finite index of a finite or infinite list.
>>> any (> 3) []
False

>>> any (> 3) [1,2]
False

>>> any (> 3) [1,2,3,4,5]
True

>>> any (> 3) [1..]
True

>>> any (> 3) [0, -1..]
* Hangs forever *
Boolean monoid under disjunction (||).
>>> getAny (Any True <> mempty <> Any False)
True
>>> getAny (mconcat (map (\x -> Any (even x)) [2,4,6,7,8]))
True
The type constructor Any is type to which you can unsafely coerce any lifted type, and back. More concretely, for a lifted type t and value x :: t, unsafeCoerce (unsafeCoerce x :: Any) :: t is equivalent to x.
Retrieve the address of any Haskell value. This is essentially an unsafeCoerce#, but if implemented as such the core lint pass complains and fails to compile. As a primop, it is opaque to core/stg, and only appears in cmm (where the copy propagation pass will get rid of it). Note that "a" must be a value, not a thunk! It's too late for strictness analysis to enforce this, so you're on your own to guarantee this. Also note that Addr# is not a GC pointer - up to you to guarantee that it does not become a dangling pointer immediately after you get it.
Zero or more.
Determines whether any element of the structure satisfies its appropriate predicate argument. Empty structures yield False.

Examples

Basic usage:
>>> biany even isDigit (27, 't')
False
>>> biany even isDigit (27, '8')
True
>>> biany even isDigit (26, 't')
True
>>> biany even isDigit (Left 27)
False
>>> biany even isDigit (Left 26)
True
>>> biany even isDigit (BiList [27, 53] ['t', '8'])
True
Empty structures yield False:
>>> biany even isDigit (BiList [] [])
False
Replicates a withXXX combinator over a list of objects, yielding a list of marshalled objects
Parses zero or more occurrences of the given parser.
Parses one or more occurrences of the given parser.
manyTill p end parses zero or more occurrences of p, until end succeeds. Returns a list of values returned by p.
Like many, but discards the result.
Like many1, but discards the result.
Returns 1# if the object is in any CNF at all, 0# otherwise.
Catch any Exception type in the IO monad. Note that this function is strict in the action. That is, catchAny undefined b == _|_. See for details.