Tweaked some parsing code
[advent-of-code-21.git] / advent21 / Main.hs
index 01d23e7017fbf1db0370e9944f94728cc8905b36..3048dafe31fddacea739847b68029a8c7e7a4192 100644 (file)
@@ -113,7 +113,7 @@ mod1 a b = ((a - 1) `mod` b) + 1
 
 -- Parsing
 
-playerP = ("1" *> pure Player1) <|> ("2" *> pure Player2)
+playerP = (Player1 <$ "1") <|> (Player2 <$ "2")
 
 playerStateP = playerify <$> ("Player " *> playerP) <*> (" starting position: " *> decimal)
   where playerify name pos = (name, PlayerState {position = pos, score = 0})