X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=advent24%2FMain.hs;h=e1836b22ca9cdf012344a6c3e60bd730d22c17d1;hb=1ab3e062eb1b3b28a8aead9834afc962ca142451;hp=ae03fac557b1f58e00cf98ae73af067cd871aa34;hpb=afdee5e8491a7ec802ad4c0897e2550cc405ac80;p=advent-of-code-21.git diff --git a/advent24/Main.hs b/advent24/Main.hs index ae03fac..e1836b2 100644 --- a/advent24/Main.hs +++ b/advent24/Main.hs @@ -217,10 +217,10 @@ eqlP = Eql <$> ("eql " *> registerP) <*> (" " *> argumentP) registerP, wP, xP, yP, zP :: Parser Register registerP = choice [wP, xP, yP, zP] -wP = "w" *> pure W -xP = "x" *> pure X -yP = "y" *> pure Y -zP = "z" *> pure Z +wP = W <$ "w" +xP = X <$ "x" +yP = Y <$ "y" +zP = Z <$ "z" argumentP :: Parser Argument argumentP = (Reg <$> registerP) <|> (Lit <$> signed decimal)