summaryrefslogtreecommitdiff
path: root/Utility/Inotify.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-04-21 23:04:59 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-04-21 23:06:19 -0400
commitbee420bd2d0cbe16489b061b208083e2b8ba9d0e (patch)
tree70ef95f81ee411513da4b6343720480cd941c42c /Utility/Inotify.hs
parentbe36aaca5bccecdff7e48b020ee62b0db3bc38f1 (diff)
in which I discover void
void :: Functor f => f a -> f () -- ah, of course that's useful :)
Diffstat (limited to 'Utility/Inotify.hs')
-rw-r--r--Utility/Inotify.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/Utility/Inotify.hs b/Utility/Inotify.hs
index 049737c08..0a261ecfe 100644
--- a/Utility/Inotify.hs
+++ b/Utility/Inotify.hs
@@ -53,10 +53,9 @@ watchDir i test add del dir = watchDir' False i test add del dir
watchDir' :: Bool -> INotify -> (FilePath -> Bool) -> Maybe (FilePath -> IO ()) -> Maybe (FilePath -> IO ()) -> FilePath -> IO ()
watchDir' scan i test add del dir = do
if test dir
- then do
+ then void $ do
_ <- addWatch i watchevents dir go
- _ <- mapM walk =<< dirContents dir
- return ()
+ mapM walk =<< dirContents dir
else return ()
where
watchevents
@@ -92,6 +91,5 @@ waitForTermination = do
check keyboardSignal mv
takeMVar mv
where
- check sig mv = do
- _ <- installHandler sig (CatchOnce $ putMVar mv ()) Nothing
- return ()
+ check sig mv = void $
+ installHandler sig (CatchOnce $ putMVar mv ()) Nothing