

I was scared of a hard combinatorial puzzle day, but this was a breeze.
{-# LANGUAGE TupleSections #-}
module Main (main) where
import Control.Monad ((<$!>))
import qualified Data.Text.IO as TextIO
import Data.Text (Text)
import qualified Data.Text as Text
import qualified Data.IntSet as IntSet
import Control.Arrow ((>>>))
import qualified Data.List as List
import qualified Data.IntMap as IntMap
part1 :: [IntSet.Key] -> IntSet.Key
part1 = IntSet.fromList
>>> IntSet.foldl (+) 0
part2 :: [IntSet.Key] -> IntSet.Key
part2 = IntSet.fromList
>>> IntSet.toAscList
>>> take 20
>>> sum
part3 :: [IntMap.Key] -> Int
part3 = List.map (, 1)
>>> IntMap.fromListWith (+)
>>> IntMap.toList
>>> List.map snd
>>> maximum
main :: IO ()
main = do
sizes <- map (read . Text.unpack) . Text.split (== ',') <$!> TextIO.getLine
print $ part1 sizes
print $ part2 sizes
print $ part3 sizes


Thank you for this update. Now that problwm and solution fit, I can understand whats going on in your code :]