Skip to content

Instantly share code, notes, and snippets.

@bavardage
Created December 30, 2009 22:31
Show Gist options
  • Select an option

  • Save bavardage/266461 to your computer and use it in GitHub Desktop.

Select an option

Save bavardage/266461 to your computer and use it in GitHub Desktop.
nub :: Eq a => [a] -> [a]
nub = foldr (\x ys->if x `elem` ys then ys else (x:ys)) []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment