[Haskell-cafe] Function to detect duplicates