On Fri, May 28, 1999 at 04:00:27PM EST, Friedrich Dominicus wrote:
> I wrote before with my trouble understanding hugsIsEOF. But I don't have
> found a clean way just to write a cat. Can s.o give me a hand?
>
Hi,
You shouldn't need to use hugsIsEOF. Here's one possible
implementation of a simple cat program:
module Main(main) where
import System
main::IO ()
main =
do
args <- getArgs
case args of
[] -> interact id
_ -> mapM_ (\f -> readFile f >>= putStr) args
Hope this helps.
David
--
David Overton Department of Computer Science & Software Engineering
MEngSc Student The University of Melbourne, Australia
+61 3 9344 9159 http://www.cs.mu.oz.au/~dmo