summaryrefslogtreecommitdiff
path: root/Utility/Inotify.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-04-21 23:32:33 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-04-21 23:32:33 -0400
commited79596b758935a3f22bf6803bc082a6bbe10f58 (patch)
tree885a8a50e68dafb39ec886cb31aa4c549fbeb35e /Utility/Inotify.hs
parentbee420bd2d0cbe16489b061b208083e2b8ba9d0e (diff)
noop
Diffstat (limited to 'Utility/Inotify.hs')
-rw-r--r--Utility/Inotify.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/Utility/Inotify.hs b/Utility/Inotify.hs
index 0a261ecfe..d41e997d6 100644
--- a/Utility/Inotify.hs
+++ b/Utility/Inotify.hs
@@ -56,7 +56,7 @@ watchDir' scan i test add del dir = do
then void $ do
_ <- addWatch i watchevents dir go
mapM walk =<< dirContents dir
- else return ()
+ else noop
where
watchevents
| isJust add && isJust del =
@@ -68,19 +68,19 @@ watchDir' scan i test add del dir = do
recurse = watchDir' scan i test add del
walk f = ifM (catchBoolIO $ Files.isDirectory <$> getFileStatus f)
( recurse f
- , if scan && isJust add then fromJust add f else return ()
+ , when (scan && isJust add) $ fromJust add f
)
- go (Created { isDirectory = False }) = return ()
+ go (Created { isDirectory = False }) = noop
go (Created { filePath = subdir }) = Just recurse <@> subdir
go (Closed { maybeFilePath = Just f }) = add <@> f
go (MovedIn { isDirectory = False, filePath = f }) = add <@> f
go (MovedOut { isDirectory = False, filePath = f }) = del <@> f
go (Deleted { isDirectory = False, filePath = f }) = del <@> f
- go _ = return ()
+ go _ = noop
Just a <@> f = a $ dir </> f
- Nothing <@> _ = return ()
+ Nothing <@> _ = noop
{- Pauses the main thread, letting children run until program termination. -}
waitForTermination :: IO ()