import System.Environment
import Data.List
import Data.List.Split
+import Data.Ord
main :: IO ()
main =
do dataFileName <- getDataFileName
- numStrs <- readFile dataFileName -- "data/advent01.txt"
+ numStrs <- readFile dataFileName
let calories = fmap (fmap (read @Int)) $ splitWhen null $ lines numStrs
print $ part1 calories
print $ part2 calories
part1 = maximum . fmap sum
part2 :: [[Int]] -> Int
-part2 = sum . take 3 . reverse . sort . fmap sum
+-- part2 = sum . take 3 . reverse . sort . fmap sum
+part2 = sum . take 3 . sortOn Down . fmap sum