Hi Eric, Ivan,
The hlint program would have flagged both of those and possiblyothers. See:
I don't think you need all those return () everywhere...
And at the end, why do you do "line <- getLine" when you don't use the result?
import Control.Concurrentimport Control.Exceptionimport Control.Monadimport Networkimport System.IOimport System.IO.Error (isEOFError)main = withSocketsDo $ dosListen <- listenOn (PortNumber 8000)putStrLn "Listening on Port 8000"forkIO $ forever $ do(sSession, hostname, port) <- accept sListenputStrLn ("Connected to " ++ hostname ++ ":" ++ show port)let processLine = forkIO $ dolineResult <- try (hGetLine sSession)case lineResult ofRight line -> doputStrLn lineprocessLinereturn ()Left e -> if isEOFError ethen print eelse ioError eprocessLinereturn()putStrLn "Press <CTRL-D> to quit."let processStdIn = dolineResult <- try getLinecase lineResult ofRight line -> processStdInLeft e -> unless (isEOFError e) $ ioError eprocessStdIn