Guest User

Untitled

a guest
Jul 22nd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. main = getContents >>= \x -> putStrLn $ unlines $ uniq $ lines x
  2.  
  3. uniq :: (Eq a) => [a] -> [a]
  4. uniq [] = []
  5. uniq (x:[]) = [x]
  6. uniq (x:xs) = if x == head xs then uniq xs else x:(uniq xs)
Add Comment
Please, Sign In to add comment