1 -- Writeup at https://work.njae.me.uk/2022/12/01/advent-of-code-2022-day-1/
10 do dataFileName <- getDataFileName
11 numStrs <- readFile dataFileName
12 let calories = fmap (fmap (read @Int)) $ splitWhen null $ lines numStrs
13 print $ part1 calories
14 print $ part2 calories
16 part1 :: [[Int]] -> Int
17 part1 = maximum . fmap sum
19 part2 :: [[Int]] -> Int
20 -- part2 = sum . take 3 . reverse . sort . fmap sum
21 part2 = sum . take 3 . sortOn Down . fmap sum