Skip to content

Commit

Permalink
Add Haskell/swekiiz 💛
Browse files Browse the repository at this point in the history
  • Loading branch information
swekiiz committed Oct 3, 2021
1 parent e06e281 commit 171e905
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Haskell/swekiiz.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
remDups :: (Eq a) => [a] -> [a] -> [a]
remDups [] _ = []
remDups (x : xs) l
| (x `elem` l) = remDups xs l
| otherwise = x : remDups xs (x : l)

removeDuplicates :: (Eq a) => [a] -> [a]
removeDuplicates list = remDups list []

refd :: String -> String
refd s =
let repl 'f' = 'd'
repl x = x
in map repl s

main = putStrLn . refd . removeDuplicates $ "Coffee"

0 comments on commit 171e905

Please sign in to comment.