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

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 nDigits n s = guard (length s == n && all isDigit s) $> s
hexColor :: String -> Maybe String 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 :: String -> Bool
validEcl = flip elem ["amb", "blu", "brn", "gry", "grn", "hzl", "oth"] validEcl = flip elem ["amb", "blu", "brn", "gry", "grn", "hzl", "oth"]