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
Tweaking and tidying
[advent-of-code-23.git]
/
advent02
/
MainApplicative.hs
diff --git
a/advent02/MainApplicative.hs
b/advent02/MainApplicative.hs
index 14cb248db042a1fb0a851608c4e7fbc5e7a71f70..acbcb5fa6741aa1b52ecbeb8a5b5b099283cb344 100644
(file)
--- a/
advent02/MainApplicative.hs
+++ b/
advent02/MainApplicative.hs
@@
-85,11
+85,11
@@
cubeP :: Parser Cube
colourP, redP, greenP, blueP :: Parser Colour
gamesP = gameP `sepBy` endOfLine
colourP, redP, greenP, blueP :: Parser Colour
gamesP = gameP `sepBy` endOfLine
-gameP = ParsedGame <$
> (("Game " *> decimal) <* ": ")
<*> showingsP
+gameP = ParsedGame <$
"Game " <*> decimal <* ": "
<*> showingsP
showingsP = showingP `sepBy` "; "
showingP = cubeP `sepBy` ", "
showingsP = showingP `sepBy` "; "
showingP = cubeP `sepBy` ", "
-cubeP = (flip Cube) <$>
(decimal <* " ")
<*> colourP
+cubeP = (flip Cube) <$>
decimal <* " "
<*> colourP
colourP = redP <|> greenP <|> blueP
redP = Red <$ "red"
colourP = redP <|> greenP <|> blueP
redP = Red <$ "red"