add whenM and unlessM

Just more golfing.. I am pretty sure something in a library somewhere can
do this, but I have been unable to find it.
This commit is contained in:
Joey Hess 2011-05-17 03:10:13 -04:00
parent 75a3f5027f
commit c91929f693
16 changed files with 60 additions and 63 deletions

View file

@ -7,8 +7,6 @@
module Command.Drop where
import Control.Monad (when)
import Command
import qualified Backend
import LocationLog
@ -46,7 +44,6 @@ perform key backend numcopies = do
cleanup :: Key -> CommandCleanup
cleanup key = do
inannex <- inAnnex key
when inannex $ removeAnnex key
whenM (inAnnex key) $ removeAnnex key
logStatus key ValueMissing
return True