Haskell Is Element In List

[Solved] Haskell Is Element In List | Haskell - Code Explorer | yomemimo.com
Question : haskell is element in list

Answered by : horrible-hamerkop-qv91dqprmbxt

-- (first:rest)
elemIn :: (Eq a) => a -> [a] -> Bool
elemIn _ [] = False
elemIn n (x:xs) = (x == n) || (elemIn n xs)

Source : https://programming-idioms.org/idiom/12/check-if-list-contains-a-value/800/haskell | Last Update : Tue, 13 Apr 21

Answers related to haskell is element in list

Code Explorer Popular Question For Haskell