Created
May 18, 2010 23:41
-
-
Save meqif/405725 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- removes duplicate adjacent elements | |
uniq_adj :: (Eq a) => [a] -> [a] | |
uniq_adj [] = [] | |
uniq_adj [x] = [x] | |
uniq_adj (x:y:z) = | |
if (x == y) then uniq_adj (y:z) | |
else x : uniq_adj (y : z) | |
prop_uniq_adj xs = length (uniq_adj xs) <= length xs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment