projects
/
advent-of-code-16.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added type signatures
[advent-of-code-16.git]
/
advent01.hs
diff --git
a/advent01.hs
b/advent01.hs
index 27a6f21db1c5351d75e3b1ce72ba5656e206cc56..a8969448c1a21cb70caf499f3d612b54ce660061 100644
(file)
--- a/
advent01.hs
+++ b/
advent01.hs
@@
-1,3
+1,5
@@
+module Main(main) where
+
import Data.List (sort)
import Data.List.Split (splitOn)
import Data.List (sort)
import Data.List.Split (splitOn)
@@
-52,7
+54,8
@@
expandSteps =
-- Execute a series of steps, keeping track of the positions after each step
takeSteps :: Position -> [Step] -> [Position]
-- Execute a series of steps, keeping track of the positions after each step
takeSteps :: Position -> [Step] -> [Position]
-takeSteps pos steps = scanl move pos steps
+-- takeSteps pos steps = scanl move pos steps
+takeSteps = scanl move
-- Make one move, by updating direction then position
move :: Position -> Step -> Position
-- Make one move, by updating direction then position
move :: Position -> Step -> Position