haskell how to delete duplicate element in list
rmdups :: (Ord a) => [a] -> [a]
rmdups l = map (head ( group ( sort l)))
-- first you sort the list, then you group all elements that are equal and then you take the first element of each list
haskell how to delete duplicate element in list
rmdups :: (Ord a) => [a] -> [a]
rmdups l = map (head ( group ( sort l)))
-- first you sort the list, then you group all elements that are equal and then you take the first element of each list
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us