Tweaked some parsing code
[advent-of-code-21.git] / advent21 / Main.hs
index 191530e7a05a21b546b6abfb2167d3501c6aa4d7..3048dafe31fddacea739847b68029a8c7e7a4192 100644 (file)
@@ -1,6 +1,6 @@
 -- Writeup at https://work.njae.me.uk/2021/12/26/advent-of-code-2021-day-21/
 
-import Debug.Trace
+-- import Debug.Trace
 
 import Data.Text ()
 import qualified Data.Text.IO as TIO
@@ -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})