--- Writeup at https://work.njae.me.uk/2023/12/18/advent-of-code-2023-day-15/
+-- Writeup at https://work.njae.me.uk/2023/12/22/advent-of-code-2023-day-18/
import AoC
instructions2P = instruction2P `sepBy` endOfLine
instruction2P =
- instrify <$> (preambleP *> (AT.take 5)) <*> (direction2P <* ")")
+ instrify <$ preambleP <*> AT.take 5 <*> direction2P <* ")"
-preambleP = (direction1P *> " " *> decimal <* " (#")
+preambleP = direction1P *> " " *> decimal <* " (#"
instrify :: Text -> Direction -> Instruction
instrify h d = Instr d (fst $ fromRight (0, "") $ TR.hexadecimal h)