aboutsummaryrefslogtreecommitdiff
path: root/challenge-072
diff options
context:
space:
mode:
authorMohammad S Anwar <Mohammad.Anwar@yahoo.com>2020-08-06 08:45:52 +0100
committerGitHub <noreply@github.com>2020-08-06 08:45:52 +0100
commit8c5f9978dcdb8fb5d57ce277b11e81be9a77bd7f (patch)
treee655c961a9905c0ba9d086e306d04b6a0f335f03 /challenge-072
parenta5e2eba2613e8c80fa470f645b2361e8e4f3811f (diff)
parent7e86928ad6ee01bf50d6a14264c491f1299f55ef (diff)
downloadperlweeklychallenge-club-8c5f9978dcdb8fb5d57ce277b11e81be9a77bd7f.tar.gz
perlweeklychallenge-club-8c5f9978dcdb8fb5d57ce277b11e81be9a77bd7f.tar.bz2
perlweeklychallenge-club-8c5f9978dcdb8fb5d57ce277b11e81be9a77bd7f.zip
Merge pull request #2042 from jeongoon/ch-072
[ch-072/jeongoon] tiny improvement in haskell
Diffstat (limited to 'challenge-072')
-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 ()