projects
/
advent-of-code-17.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aef09db
)
Simplified the parser
author
Neil Smith
<neil.git@njae.me.uk>
Wed, 20 Dec 2017 21:54:00 +0000
(21:54 +0000)
committer
Neil Smith
<neil.git@njae.me.uk>
Wed, 20 Dec 2017 21:54:00 +0000
(21:54 +0000)
src/advent20/advent20.hs
patch
|
blob
|
history
diff --git
a/src/advent20/advent20.hs
b/src/advent20/advent20.hs
index 4d852a604d299fcf9ca7f762867c72dd4074bfc5..4822db9ec324c983cee9017925a74533840d30cf 100644
(file)
--- a/
src/advent20/advent20.hs
+++ b/
src/advent20/advent20.hs
@@
-109,12
+109,11
@@
integer = lexeme L.integer
signedInteger = L.signed sc integer
symbol = L.symbol sc
-separator = symbol ", "
comma = symbol ","
particlesP = particleP `sepBy` space
-particleP = particlify <$> (symbol "p=" *> vecP <*
separator
)
- <*> (symbol "v=" *> vecP <*
separator
)
+particleP = particlify <$> (symbol "p=" *> vecP <*
comma
)
+ <*> (symbol "v=" *> vecP <*
comma
)
<*> (symbol "a=" *> vecP)
where particlify p v a = Particle { position = p
, velocity = v