Check Duplications in List

camm 2018-03-04 04:10:06.461528 UTC

1checkDuplication :: [Val] -> [Val]
2checkDuplication list =
3 case findDups list of
4 [] -> list
5 dups -> error $ "The following values are duplicated: " ++ toString dups
6 where
7 findDups = functionToGetDups