:: Eq a => [a] -> a -> Bool -package:numhask -package:data-ordlist package:loc

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 *