From 7e86928ad6ee01bf50d6a14264c491f1299f55ef Mon Sep 17 00:00:00 2001 From: Myoungjin JEON Date: Thu, 6 Aug 2020 17:40:27 +1000 Subject: [ch-072/jeongoon] tiny improvement in haskell --- challenge-072/jeongoon/haskell/ch-2.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/challenge-072/jeongoon/haskell/ch-2.hs b/challenge-072/jeongoon/haskell/ch-2.hs index 14d0fb9054..3fd5352350 100644 --- a/challenge-072/jeongoon/haskell/ch-2.hs +++ b/challenge-072/jeongoon/haskell/ch-2.hs @@ -28,10 +28,11 @@ putLinesBetween fh from to acc putStrLn $ "[WRN] line starts from: 1 not: " ++ show from putStrLn $ "[INF] -> Starts with line no. 1 again." putLinesBetween fh 1 to acc - | acc >= from && acc <= to = do + | acc >= from && acc <= to = + do line <- hGetLine fh putStrLn line - putLinesBetween fh from to (acc+1) + putLinesBetween fh from to $! (acc+1) | otherwise = return () toTry :: IO () -- cgit