module Main where import qualified Day1 as D1 import qualified Day2 as D2 solutions :: [(String -> String, String -> String)] solutions = [(D1.part1, D1.part2), (D2.part1, D2.part2)] run :: Int -> Int -> IO () run day part = do input <- readFile ("inputs/" ++ show day) let select = if part == 1 then fst else snd putStrLn $ select (solutions !! (day - 1)) input pure () main :: IO () main = do day <- getLine problem <- getLine run (read day :: Int) (read problem :: Int)