summaryrefslogtreecommitdiff
path: root/Annex/NumCopies.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-12-05 15:00:50 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-12-05 15:00:50 -0400
commit236c467da19f34edb08f124e37fd26eb62c43fcf (patch)
treef4e488f77fb954812e4d48f399fc2ecab072afea /Annex/NumCopies.hs
parentf013f71cb5d3f7eee3afb3eb8f01a33206d717c4 (diff)
more lambda-case conversion
Diffstat (limited to 'Annex/NumCopies.hs')
-rw-r--r--Annex/NumCopies.hs15
1 files changed, 6 insertions, 9 deletions
diff --git a/Annex/NumCopies.hs b/Annex/NumCopies.hs
index 5e818fe95..9fea49db6 100644
--- a/Annex/NumCopies.hs
+++ b/Annex/NumCopies.hs
@@ -121,24 +121,21 @@ verifyEnoughCopiesToDrop
verifyEnoughCopiesToDrop nolocmsg key removallock need skip preverified tocheck dropaction nodropaction =
helper [] [] preverified (nub tocheck)
where
- helper bad missing have [] = do
- p <- liftIO $ mkSafeDropProof need have removallock
- case p of
+ helper bad missing have [] =
+ liftIO (mkSafeDropProof need have removallock) >>= \case
Right proof -> dropaction proof
Left stillhave -> do
notEnoughCopies key need stillhave (skip++missing) bad nolocmsg
nodropaction
helper bad missing have (c:cs)
- | isSafeDrop need have removallock = do
- p <- liftIO $ mkSafeDropProof need have removallock
- case p of
+ | isSafeDrop need have removallock =
+ liftIO (mkSafeDropProof need have removallock) >>= \case
Right proof -> dropaction proof
Left stillhave -> helper bad missing stillhave (c:cs)
| otherwise = case c of
UnVerifiedHere -> lockContentShared key contverified
- UnVerifiedRemote r -> checkremote r contverified $ do
- haskey <- Remote.hasKey r key
- case haskey of
+ UnVerifiedRemote r -> checkremote r contverified $
+ Remote.hasKey r key >>= \case
Right True -> helper bad missing (mkVerifiedCopy RecentlyVerifiedCopy r : have) cs
Left _ -> helper (r:bad) missing have cs
Right False -> helper bad (Remote.uuid r:missing) have cs