
forgot to paste in the error message, oops
copy_take.lhs:48:51:
Couldn't match expected type `IO ()' with actual type `Handler'
In the second argument of `($)', namely
`Catch $ worldHandler world jCount'
In the second argument of `installHandler', namely
`(forkIO $ Catch $ worldHandler world jCount)'
In a stmt of a 'do' expression:
installHandler
userDefinedSignal1
(forkIO $ Catch $ worldHandler world jCount)
Nothing
Failed, modules loaded:
On Fri, Sep 9, 2011 at 12:53 PM, Michael Litchard
Here's the error message. The problem is clear, not sure what to do about it. My broken code should show my intent though.
main :: IO () main = do let world = (newEmptyTMVar :: ProcessState) let jCount = (newEmptyTMVar :: JobCount) installHandler userDefinedSignal1 (forkIO $ Catch $ worldHandler world jCount) Nothing sequence_ $ repeat $ worldCheck
I'd like to fork in Main. Right now I'm forking in worldHandler. If that's what I have to do, then I'll just move on. But I'd like to keep the forkIO call in Main if possible.
On Fri, Sep 9, 2011 at 12:46 PM, Brandon Allbery
wrote: On Fri, Sep 9, 2011 at 15:35, Michael Litchard
wrote: Thanks for the reply. The problem isn't signal handling, nor is it using forkIO. It's using both of them together.
I think you'll have to provide an example of what you're trying to do and the error message you get. -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms