September 2017
Beginner to intermediate
396 pages
9h 46m
English
stack new io-monad simple
import System.IO (hGetLine, hIsEOF, withFile, Handle, IOMode(..)) import System.Environment (getArgs) import Control.Monad import Data.List (intercalate)
-- From the file handle, check if we have reached end of file, -- otherwise read the file line by line getLinesSeq :: Handle -> IO [String] getLinesSeq h = do eof <- hIsEOF h -- Use (:) to ...
Read now
Unlock full access