:: Eq a => [a] -> a -> Bool -package:base

(∋) = flip (∈) U+220B, CONTAINS AS MEMBER
(∌) = flip (∉) U+220C, DOES NOT CONTAIN AS MEMBER
(∋) = flip (∈) U+220B, CONTAINS AS MEMBER
(∌) = flip (∉) U+220C, DOES NOT CONTAIN AS MEMBER
The has function returns True if the element appears in the list; it is equivalent to member except the order of the arguments is reversed, making it a function from an ordered list to its characteristic function.
Check membership for the same list often. Use partially applied to create membership predicate hasElem xs :: a -> Bool.
  • First time: O(n log n) in the worst case.
  • Subsequently: O(log n).
Specification: hasElem xs == (elem xs).
(∈) = elem U+2208, ELEMENT OF
(∉) = notElem U+2209, NOT AN ELEMENT OF
Does the element occur in the structure?
notElem is the negation of elem.
Does the element occur in the structure?
O(n) Check if the vector contains an element
O(n) Check if the vector does not contain an element (inverse of elem)
(∈) = elem U+2208, ELEMENT OF
(∉) = notElem U+2209, NOT AN ELEMENT OF
The member function returns True if the element appears in the ordered list.
Test element using ordered set.
Test not element using ordered set.