wc = do putStr ( "Filename; " ) name <- getLine contents <- readFile name let ( cc, w, lc ) = wcf( 0, 0, 0 ) contents putStrLn ( "The file:" ++ name ++ " has " ) putStrLn ( show cc ++ " chars " ) putStrLn ( show w ++ " words " ) putStrLn ( show lc ++ " lines." )