From 62183b8bc18259742d420ee96ab85fbb33397ffd Mon Sep 17 00:00:00 2001 From: Laura Orvokki Kursula Date: Sat, 7 Dec 2024 23:58:47 +0100 Subject: Clean up code (mostly just an excuse for testing magit) --- 7-1.hs | 4 +--- 7-2.hs | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/7-1.hs b/7-1.hs index 81a6ba5..051ed9f 100644 --- a/7-1.hs +++ b/7-1.hs @@ -17,6 +17,4 @@ result xs = sum . map fst . filter snd $ zip (map fst xs) (map (uncurry check) xs) main :: IO () -main = do - ls <- lines <$> getContents - print . result . map parseLine $ ls +main = getContents >>= print . result . map parseLine . lines diff --git a/7-2.hs b/7-2.hs index f191196..63a2df5 100644 --- a/7-2.hs +++ b/7-2.hs @@ -20,6 +20,4 @@ result xs = sum . map fst . filter snd $ zip (map fst xs) (map (uncurry check) xs) main :: IO () -main = do - ls <- lines <$> getContents - print . result . map parseLine $ ls +main = getContents >>= print . result . map parseLine . lines -- cgit v1.2.3