diff --git a/src/Monocle/Config.hs b/src/Monocle/Config.hs index 10c66d99b..f0e058253 100644 --- a/src/Monocle/Config.hs +++ b/src/Monocle/Config.hs @@ -87,7 +87,7 @@ module Monocle.Config ( import Data.Aeson qualified as Aeson import Data.ByteString qualified as BS -import Data.Char (isLowerCase) +import Data.Char (isLetter, isLowerCase) import Data.Either.Validation (Validation (Failure, Success)) import Data.Map qualified as Map import Data.Text qualified as T (all, dropWhileEnd, isPrefixOf, null, replace, toUpper, uncons, unpack) @@ -485,7 +485,7 @@ mkIndexName x = do let check name p = if p then Right () else Left name check "Is empty" $ not $ T.null x check "Is longer than 255 bytes" $ BS.length (T.encodeUtf8 x) < 256 - check "Contains uppercase letter(s)" $ T.all isLowerCase x + check "Contains uppercase letter(s)" $ T.all (\x -> not (isLetter x) || isLowerCase x) x check "Includes [\\/*?\"<>| ,#:]" $ T.all (flip @_ @String notElem "\\/*?\"<>| ,#:") x check "Starts with [-_+.]" $ maybe False (flip @_ @String notElem "-_+." . fst) $ T.uncons x check "Is (.|..)" $ notElem x [".", ".."]