From 643b9235844d730aa9f0340da2a290a3c42bbccc Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sat, 11 Dec 2010 20:44:27 +0100 Subject: Couple of nits for the previous patch (Mail.hs) --- Plugins/Mail.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Plugins/Mail.hs b/Plugins/Mail.hs index 165467a..89cac30 100644 --- a/Plugins/Mail.hs +++ b/Plugins/Mail.hs @@ -45,12 +45,12 @@ instance Exec Mail where i <- initINotify zipWithM_ (\d v -> addWatch i ev d (handle v)) ds vs - forM (zip ds vs) $ \(d, v) -> do + forM_ (zip ds vs) $ \(d, v) -> do s <- fmap (S.fromList . filter (not . isPrefixOf ".")) $ getDirectoryContents d atomically $ modifyTVar v (S.union s) - changeLoop (mapM (fmap S.size . readTVar) vs) $ \ns -> do + changeLoop (mapM (fmap S.size . readTVar) vs) $ \ns -> cb . unwords $ [m ++ ":" ++ show n | (m, n) <- zip ts ns , n /= 0 ] @@ -59,7 +59,7 @@ modifyTVar :: TVar a -> (a -> a) -> STM () modifyTVar v f = readTVar v >>= writeTVar v . f expandHome :: FilePath -> IO FilePath -expandHome ('~':'/':path) = getEnv "HOME" >>= return . flip () path +expandHome ('~':'/':path) = fmap ( path) (getEnv "HOME") expandHome p = return p handle :: TVar (Set String) -> Event -> IO () -- cgit v1.2.3