summary refs log tree commit diff
path: root/2
diff options
context:
space:
mode:
authortzlil <tzlils@protonmail.com>2023-12-02 21:27:17 +0200
committertzlil <tzlils@protonmail.com>2023-12-02 21:27:17 +0200
commit1fd224e40011ee0a63aa7955fe79b616a4dfa6dd (patch)
tree3bead4bfabd864c3ee24c2ed13e492afbce0ea53 /2
parentcd31a8035a378cf58242444f9068f7d441ff42a7 (diff)
can get rid of some parens
Diffstat (limited to '2')
-rw-r--r--2/2.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/2/2.hs b/2/2.hs
index ba01542..55619a2 100644
--- a/2/2.hs
+++ b/2/2.hs
@@ -20,11 +20,11 @@ color = red <|> green <|> blue
 handful = liftM2 (flip (,)) (space *> (read <$> many1 digit)) (space *> color)
 
 set = M.fromList <$> (sepBy handful $ string ",")
-game = liftM2 (,) (string "Game " *> (read <$> many1 digit)) (string ":" *> sepBy set (string ";"))
+game = (,) <$> (string "Game " *> (read <$> many1 digit)) <*> (string ":" *> sepBy set (string ";"))
 
 games = sepBy game newline
 
 solution :: Game -> Int
 solution = product . M.elems . M.unionsWith max . snd
 
-main = liftM2 (>>=) readFile (((print . sum . map solution . either (error.show) id) .) . parse games) =<< head <$> getArgs
\ No newline at end of file
+main = (>>=) <$> readFile <*> ((print . sum . map solution . either (error.show) id) .) . parse games =<< head <$> getArgs
\ No newline at end of file