X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=advent18%2FMain.hs;h=97bcf6d35396769877a2f839c949de90882f2e23;hb=a7b02636b8045a73a4dff090c1b932cfa1afd9bd;hp=9e5a97c5beadb6c76f1a3f75abc6c4bc1b7697eb;hpb=bc689ec22856749b96406382eac0345f2f71cb40;p=advent-of-code-23.git diff --git a/advent18/Main.hs b/advent18/Main.hs index 9e5a97c..97bcf6d 100644 --- a/advent18/Main.hs +++ b/advent18/Main.hs @@ -79,9 +79,9 @@ direction2P = choice [ U <$ "3" 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)