X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=advent12%2FMain.hs;h=7f1177d387fb7257ba7f0144a2b235505b52ec27;hb=refs%2Fheads%2Fmain;hp=2c07b389c78b434da585a14d2c2bc5d40a3bf214;hpb=3af07db033456d04a8c0f307b20fc6ca0ffcba9e;p=advent-of-code-23.git diff --git a/advent12/Main.hs b/advent12/Main.hs index 2c07b38..7f1177d 100644 --- a/advent12/Main.hs +++ b/advent12/Main.hs @@ -82,7 +82,7 @@ recordP :: Parser Record springP :: Parser Spring recordsP = recordP `sepBy` endOfLine -recordP = Record <$> (many1 springP <* " ") <*> (decimal `sepBy` ",") +recordP = Record <$> many1 springP <* " " <*> decimal `sepBy` "," springP = (Unknown <$ "?") <|> (Damaged <$ "#") <|> (Operational <$ ".") successfulParse :: Text -> [Record]