X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;ds=sidebyside;f=advent12%2FMain.hs;fp=advent12%2FMain.hs;h=7f1177d387fb7257ba7f0144a2b235505b52ec27;hb=a7b02636b8045a73a4dff090c1b932cfa1afd9bd;hp=2c07b389c78b434da585a14d2c2bc5d40a3bf214;hpb=bc689ec22856749b96406382eac0345f2f71cb40;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]