projects
/
advent-of-code-23.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Faster day 14, with mutable unboxed arrays
[advent-of-code-23.git]
/
advent18
/
Main.hs
diff --git
a/advent18/Main.hs
b/advent18/Main.hs
index 9e5a97c5beadb6c76f1a3f75abc6c4bc1b7697eb..97bcf6d35396769877a2f839c949de90882f2e23 100644
(file)
--- a/
advent18/Main.hs
+++ b/
advent18/Main.hs
@@
-79,9
+79,9
@@
direction2P = choice [ U <$ "3"
instructions2P = instruction2P `sepBy` endOfLine
instruction2P =
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)
instrify :: Text -> Direction -> Instruction
instrify h d = Instr d (fst $ fromRight (0, "") $ TR.hexadecimal h)