aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMyoungjin JEON <jeongoon@gmail.com>2020-08-06 17:40:27 +1000
committerMyoungjin JEON <jeongoon@gmail.com>2020-08-06 17:40:27 +1000
commit7e86928ad6ee01bf50d6a14264c491f1299f55ef (patch)
tree7b4d62bb768b51034ff86dcc980edd54f5f27eb3
parent60aa771d39fb5ee8d49a78555786a53ab1e194ff (diff)
downloadperlweeklychallenge-club-7e86928ad6ee01bf50d6a14264c491f1299f55ef.tar.gz
perlweeklychallenge-club-7e86928ad6ee01bf50d6a14264c491f1299f55ef.tar.bz2
perlweeklychallenge-club-7e86928ad6ee01bf50d6a14264c491f1299f55ef.zip
[ch-072/jeongoon] tiny improvement in haskell
-rw-r--r--challenge-072/jeongoon/haskell/ch-2.hs5
1 files 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 ()