elem -package:base

O(n) elem is the ByteString membership predicate.
O(n) elem is the ByteString membership predicate. This implementation uses memchr(3).
O(n) elem is the ShortByteString membership predicate.
O(n) The elem function takes a character and a Text, and returns True if the element is found in the given Text, or False otherwise.
O(n) elem is the stream membership predicate. Properties
elem c . stream = elem c
O(n) Check if the vector contains an element.
Check whether the Bundle contains an element
Check whether the Bundle contains an element
O(n) Check if the vector contains an element.
O(n) Check if the vector contains an element.
O(n) Check if the vector contains an element.
O(n) Check if the vector contains an element.
Are any values in the stream equal to the given value? Stops consuming as soon as a match is found. Subject to fusion
Does the element occur in the structure? Note: elem is often used in infix form.

Examples

Basic usage:
>>> 3 `elem` []
False
>>> 3 `elem` [1,2]
False
>>> 3 `elem` [1,2,3,4,5]
True
For infinite structures, the default implementation of elem terminates if the sought-after value exists at a finite distance from the left side of the structure:
>>> 3 `elem` [1..]
True
>>> 3 `elem` ([4..] ++ [3])
* Hangs forever *
(elem a p) returns True if p has an element equal to a, False otherwise
(elem a) returns True if the container has an element equal to a, False otherwise
(elem w8) returns True if the byte stream has a byte equal to w8, False otherwise
(elem c) returns True if the text stream has a character equal to c, False otherwise
Like elem but doesn't work on Set and HashSet for performance reasons.
>>> elem 'x' ("abc" :: String)
False

>>> elem False (one True :: Set Bool)
...
... Do not use 'elem' and 'notElem' methods from 'Foldable' on Set
Suggestions:
Instead of
elem :: (Foldable t, Eq a) => a -> t a -> Bool
use
member :: Ord a => a -> Set a -> Bool
...
Instead of
notElem :: (Foldable t, Eq a) => a -> t a -> Bool
use
not . member
...
Exhaust a stream remembering only whether a was an element.