X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=advent21%2FMain.hs;h=3048dafe31fddacea739847b68029a8c7e7a4192;hb=1ab3e062eb1b3b28a8aead9834afc962ca142451;hp=01d23e7017fbf1db0370e9944f94728cc8905b36;hpb=4506b761e9bc00ea63e0dbc93f6b619b02895e15;p=advent-of-code-21.git diff --git a/advent21/Main.hs b/advent21/Main.hs index 01d23e7..3048daf 100644 --- a/advent21/Main.hs +++ b/advent21/Main.hs @@ -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})