Skip to content

Instantly share code, notes, and snippets.

@igorgue
Created August 3, 2009 20:05
Show Gist options
  • Save igorgue/160801 to your computer and use it in GitHub Desktop.
Save igorgue/160801 to your computer and use it in GitHub Desktop.
elem' :: (Eq a) => a -> [a] -> Bool
elem' x xs = if head xs == x
then
True
else
if length xs == 1
then
False
else
elem' x (tail xs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment