advent-of-code/common/AoC.hs

12 lines
320 B
Haskell
Raw Normal View History

2020-12-05 09:53:27 +01:00
module AoC where
(.:) :: (c -> d) -> (a -> b -> c) -> a -> b -> d
f .: g = (f .) . g
infixl 8 .:
runAoC :: (Show r1, Show r2) => (String -> i) -> (i -> r1) -> (i -> r2) -> IO ()
runAoC inputTransform part1 part2 = do
contents <- inputTransform <$> getContents
print $ part1 contents
print $ part2 contents