-- | update the 'Conc.MVar' by adding 1 or removing 1
updateMVar
    :: Conc.MVar Int -- ^ MVar to update
    -> Action -- ^ 'Add' or 'Remove' the file from the count in the 'Conc.MVar'
    -> Bool -- ^ if the file is a folder we ignore it
    -> IO ()
updateMVar mvar action isDir =
    unless isDir $
    case action of
        Add -> Conc.modifyMVar_ mvar $ \x -> return (x + 1)
        Remove -> Conc.modifyMVar_ mvar $ \x -> return (x - 1)

-- | Find all the subfolders of 'mailFolder' called @new@
updateMVar
    :: Conc.MVar Int -- ^ MVar to update
    -> Action -- ^ 'Add' or 'Remove' the file from the count in the 'Conc.MVar'
    -> Bool -- ^ if the file is a folder we ignore it
    -> IO ()
updateMVar mvar action isDir =
    unless isDir $
    case action of
        Add -> Conc.modifyMVar_ mvar $ \x -> return (x + 1)
        Remove -> Conc.modifyMVar_ mvar $ \x -> return (x - 1)

-- | Find all the subfolders of 'mailFolder' called @new@
updateMVar mvar action isDir =
    unless isDir $
    case action of
        Add -> Conc.modifyMVar_ mvar $ \x -> return (x + 1)
        Remove -> Conc.modifyMVar_ mvar $ \x -> return (x - 1)

-- | Find all the subfolders of 'mailFolder' called @new@