George Russell wrote:

For the development snapshot 6.3.20031201, System.Posix.forkProcess
has the type IO () -> IO System.Posix.Types.ProcessID.  In 6.0.1
it has type IO () -> IO (Maybe System.Posix.Types.ProcessID).  Is
this change intentional, and if so how are you supposed to test
after the fork if this is the parent or child process?

The following example should explain everything:


Old Version:

do
    mbPid <- forkProcess
    case mbPid of
        Nothing -> putStrLn "Child"
        Just pid -> putStrLn $ "Parent of " ++ show pid

New Version:

do
    pid <- forkProcess (putStrLn "Child")
    putStrLn $ "Parent of " ++ show pid



Cheers,

Wolfgang

_______________________________________________
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to