elem package:relude

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
...
Check that a type is an element of a list:
>>> :kind! Elem String '[]
Elem String '[] :: Bool
= 'False
>>> :kind! Elem String '[Int, String]
Elem String '[Int, String] :: Bool
= 'True
>>> :kind! Elem String '[Int, Bool]
Elem String '[Int, Bool] :: Bool
= 'False
Converts the structure to the list of the values.
>>> elems (HashMap.fromList [('a', "xxx"), ('b', "yyy")])
["xxx","yyy"]
Like notElem but doesn't work on Set and HashSet for performance reasons.
>>> notElem 'x' ("abc" :: String)
True

>>> notElem 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
...
Does the element occur in the structure?

Examples

Basic usage:
>>> bielem 42 (17, 42)
True
>>> bielem 42 (17, 43)
False
>>> bielem 42 (Left 42)
True
>>> bielem 42 (Right 13)
False
>>> bielem 42 (BiList [1..5] [1..100])
True
>>> bielem 42 (BiList [1..5] [1..41])
False