projects
/
advent-of-code-23.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tidying, mainly parsers
[advent-of-code-23.git]
/
advent12
/
Main.hs
diff --git
a/advent12/Main.hs
b/advent12/Main.hs
index 2c07b389c78b434da585a14d2c2bc5d40a3bf214..7f1177d387fb7257ba7f0144a2b235505b52ec27 100644
(file)
--- a/
advent12/Main.hs
+++ b/
advent12/Main.hs
@@
-82,7
+82,7
@@
recordP :: Parser Record
springP :: Parser Spring
recordsP = recordP `sepBy` endOfLine
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]
springP = (Unknown <$ "?") <|> (Damaged <$ "#") <|> (Operational <$ ".")
successfulParse :: Text -> [Record]