Skip to content

Instantly share code, notes, and snippets.

@spion
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spion/9513772 to your computer and use it in GitHub Desktop.
Save spion/9513772 to your computer and use it in GitHub Desktop.
myequal :: Eq a => [a] -> [a] -> Bool
-- two empty lists are equal
myequal [] [] = True
-- two non-empty lists are equal when their first elements are equal and the remainder of the lists are also equal
myequal (x:xs) (y:ys) = x == y && myeqal xs ys
-- all other lists are not equal
myequal _ _ = False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment