【发布时间】:2019-02-22 18:20:50
【问题描述】:
我在xmonad 包中看到以下代码:
-- | Ignore SIGPIPE to avoid termination when a pipe is full, and SIGCHLD to
-- avoid zombie processes, and clean up any extant zombie processes.
installSignalHandlers :: MonadIO m => m ()
installSignalHandlers = io $ do
installHandler openEndedPipe Ignore Nothing
installHandler sigCHLD Ignore Nothing
(try :: IO a -> IO (Either SomeException a))
$ fix $ \more -> do
x <- getAnyProcessStatus False False
when (isJust x) more
return ()
看来fix这个函数来自Data.Function
但我不明白它是如何在这里使用的,什么时候有人会使用这个修复功能?
【问题讨论】:
标签: haskell fixpoint-combinators