:: Eq a => [a] -> a -> Bool -package:hedgehog -package:data-ordlist package:base

elem is the list membership predicate, usually written in infix form, e.g., x `elem` xs. For the result to be False, the list must be finite; True, however, results from an element equal to x found at a finite index of a finite or infinite list.
>>> 3 `elem` []
False

>>> 3 `elem` [1,2]
False

>>> 3 `elem` [1,2,3,4,5]
True

>>> 3 `elem` [1..]
True

>>> 3 `elem` [4..]
* Hangs forever *
notElem is the negation of elem.
>>> 3 `notElem` []
True

>>> 3 `notElem` [1,2]
True

>>> 3 `notElem` [1,2,3,4,5]
False

>>> 3 `notElem` [1..]
False

>>> 3 `notElem` [4..]
* Hangs forever *
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 *
notElem is the negation of elem.

Examples

Basic usage:
>>> 3 `notElem` []
True
>>> 3 `notElem` [1,2]
True
>>> 3 `notElem` [1,2,3,4,5]
False
For infinite structures, notElem terminates if the value exists at a finite distance from the left side of the structure:
>>> 3 `notElem` [1..]
False
>>> 3 `notElem` ([4..] ++ [3])
* Hangs forever *