projects
/
adventofcode2018.git
/ blame
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blob
|
blame
(incremental) |
history
|
HEAD
Complete Day 1
[adventofcode2018.git]
/
day01
/
part1.hs
Commit
Line
Data
b2f8fbc5
JK
1
main = do
2
contents <- getContents
3
print . sum $ map toInt (lines contents)
4
5
toInt :: String -> Int
6
toInt (x:xs) = if x == '+'
7
then read xs :: Int
8
else -(read xs :: Int)