AoC2018/Day01/Part1.hs

9 lines
232 B
Haskell
Executable File

#! /usr/bin/env stack
-- stack --resolver lts-12.20 --install-ghc script
module Main where
main :: IO ()
main = interact $ show . \input ->
let changes = fmap (read . dropWhile (=='+')) $ lines input
in (sum changes :: Int)