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
/
MainBruteForce.hs
diff --git
a/advent12/MainBruteForce.hs
b/advent12/MainBruteForce.hs
index 6b8620395a377b30138beae95080ccfa3895606d..7d11334d9c38ea378d8ffb4589ea7b2f7dd5b48b 100644
(file)
--- a/
advent12/MainBruteForce.hs
+++ b/
advent12/MainBruteForce.hs
@@
-78,7
+78,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]