:: Eq a => [a] -> a -> Bool -package:numhask -package:intro -package:basic-prelude package:cabal-install

hasElem xs x = elem x xs except that xs is turned into a Set first. Use underapplied to speed up subsequent lookups, e.g. filter (hasElem xs) ys. Only amortized when used several times! Time complexity <math> for <math> lookups in a list of length <math>. (Compare this to elem's <math>.) This is Agda.Utils.List.hasElem.