|
|
@ -25,7 +25,7 @@ type PID = T.Text |
|
|
|
|
|
|
|
|
|
|
|
type CID = T.Text |
|
|
|
type CID = T.Text |
|
|
|
|
|
|
|
|
|
|
|
data Passport = Passport |
|
|
|
data Passport = ValidPassport |
|
|
|
{ byr :: BYR, |
|
|
|
{ byr :: BYR, |
|
|
|
iyr :: IYR, |
|
|
|
iyr :: IYR, |
|
|
|
eyr :: EYR, |
|
|
|
eyr :: EYR, |
|
|
@ -56,7 +56,7 @@ fromMap m = do |
|
|
|
hcl <- m M.!? "hcl" |
|
|
|
hcl <- m M.!? "hcl" |
|
|
|
ecl <- m M.!? "ecl" |
|
|
|
ecl <- m M.!? "ecl" |
|
|
|
pid <- m M.!? "pid" |
|
|
|
pid <- m M.!? "pid" |
|
|
|
return $ Passport byr iyr eyr hgt hcl ecl pid (m M.!? "cid") |
|
|
|
return $ ValidPassport byr iyr eyr hgt hcl ecl pid (m M.!? "cid") |
|
|
|
|
|
|
|
|
|
|
|
parserPassport :: P.Parser (Maybe Passport) |
|
|
|
parserPassport :: P.Parser (Maybe Passport) |
|
|
|
parserPassport = fromMap <$> parserEntry |
|
|
|
parserPassport = fromMap <$> parserEntry |
|
|
|