Skip to content

Instantly share code, notes, and snippets.

@applePrincess
Created December 2, 2018 11:55
Show Gist options
  • Save applePrincess/419b36cd7a6c49f88cd6425149b2f5f9 to your computer and use it in GitHub Desktop.
Save applePrincess/419b36cd7a6c49f88cd6425149b2f5f9 to your computer and use it in GitHub Desktop.
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeApplications #-}
module Day1 (main) where
import qualified Data.Text as T
import qualified Data.Text.IO as TIO
main = TIO.interact (T.pack . solve . T.splitOn "," . T.replace "+" " ")
where solve = show . sum . map (read @Int . T.unpack)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment