Determine if a string has all unique characters: Difference between revisions

Content added Content deleted
(→‎{{header|Haskell}}: Added a variation (fusion) within the string-folding draft.)
Line 530: Line 530:
(zip [0 ..] xs))))
(zip [0 ..] xs))))


-- OR, fusing filter and minimumByMay down to a single fold:
-- OR, fusing filter, toList and minimumByMay down to a single fold:
duplicatedCharIndices_ :: String -> Maybe (Char, [Int])
duplicatedCharIndices_ :: String -> Maybe (Char, [Int])
duplicatedCharIndices_ xs =
duplicatedCharIndices_ xs =