diff --git a/src/Plugins/Mail.hs b/src/Plugins/Mail.hs index 58431ce..2d0be37 100644 --- a/src/Plugins/Mail.hs +++ b/src/Plugins/Mail.hs @@ -49,18 +49,18 @@ instance Exec Mail where forM_ (zip ds vs) $ \(d, v) -> do s <- fmap (S.fromList . filter (not . isPrefixOf ".")) $ getDirectoryContents d - atomically $ modifyTVar v (S.union s) + atomically $ modifyTVarxm v (S.union s) changeLoop (mapM (fmap S.size . readTVar) vs) $ \ns -> cb . unwords $ [m ++ ":" ++ show n | (m, n) <- zip ts ns , n /= 0 ] -modifyTVar :: TVar a -> (a -> a) -> STM () -modifyTVar v f = readTVar v >>= writeTVar v . f +modifyTVarxm :: TVar a -> (a -> a) -> STM () +modifyTVarxm v f = readTVar v >>= writeTVar v . f handle :: TVar (Set String) -> Event -> IO () -handle v e = atomically $ modifyTVar v $ case e of +handle v e = atomically $ modifyTVarxm v $ case e of Created {} -> create MovedIn {} -> create Deleted {} -> delete diff --git a/src/Plugins/Monitors/MPD.hs b/src/Plugins/Monitors/MPD.hs index 60c3e48..757c1ca 100644 --- a/src/Plugins/Monitors/MPD.hs +++ b/src/Plugins/Monitors/MPD.hs @@ -102,5 +102,5 @@ showTime t = int2str minutes ++ ":" ++ int2str seconds where minutes = t `div` 60 seconds = t `mod` 60 -int2str :: (Num a, Ord a) => a -> String +int2str :: (Num a, Ord a, Show a) => a -> String int2str x = if x < 10 then '0':sx else sx where sx = show x