Skip to content

Instantly share code, notes, and snippets.

@terry182
Last active April 26, 2018 18:29
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 terry182/3f31de2b19c66db208d84afafa539ec9 to your computer and use it in GitHub Desktop.
Save terry182/3f31de2b19c66db208d84afafa539ec9 to your computer and use it in GitHub Desktop.
nub' :: [Int] -> [Int]
nub' (x:xs) | elem x xs = nub' xs
| otherwise = x:(nub' xs)
nub' [] = []
nub = reverse . nub' . reverse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment