joamoiwamepfuewaf

This commit is contained in:
Michael Zhang 2020-12-04 19:04:32 -06:00
parent ffb5f12540
commit b20b246a88
Signed by: michael
GPG Key ID: BDA47A31A3C8EE6B
1 changed files with 1 additions and 1 deletions

2
4.hs
View File

@ -19,7 +19,7 @@ nDigits :: Int -> String -> Maybe String
nDigits n s = guard (length s == n && all isDigit s) $> s
hexColor :: String -> Maybe String
hexColor s = guard (length s == 7 && s !! 0 == '#' && all (\c -> elem c "0123456789abcdef") (drop 1 s)) $> s
hexColor s = guard (length s == 7 && s !! 0 == '#' && all (flip elem "0123456789abcdef") (drop 1 s)) $> s
validEcl :: String -> Bool
validEcl = flip elem ["amb", "blu", "brn", "gry", "grn", "hzl", "oth"]