Skip to content

Instantly share code, notes, and snippets.

@hrldcpr
Last active December 12, 2015 12:39
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 hrldcpr/4773572 to your computer and use it in GitHub Desktop.
Save hrldcpr/4773572 to your computer and use it in GitHub Desktop.
dedup [] = []
dedup (x:xs) = dedup' x xs
where
dedup' x [] = [x]
dedup' x (x:xs) = dedup' x xs
dedup' y (x:xs) = y : dedup' x xs
dedup [] = []
dedup (x:xs) = dedup' x xs
where
dedup' x [] = [x]
dedup' y (x:xs) | x == y = dedup' x xs
| otherwise = y : dedup' x xs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment