Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import qualified Data.ByteString.Lazy.Char8 as L
- import Control.Monad
- import System.IO
- import Data.IORef
- hLines :: Handle -> IO [L.ByteString]
- hLines h = L.hGetContents h >>= pure . L.lines
- main :: IO ()
- main = do
- cnt <- newIORef 0
- input <- hLines stdin
- flip mapM_ input $ \line -> do
- L.putStr line
- modifyIORef cnt (+1)
- cur <- readIORef cnt
- if cur > 100
- then L.putStr (input !! (cur - 100))
- else return ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement