aboutsummaryrefslogtreecommitdiff
path: root/Command/CheckPresentKey.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 /Command/CheckPresentKey.hs
parentf013f71cb5d3f7eee3afb3eb8f01a33206d717c4 (diff)
more lambda-case conversion
Diffstat (limited to 'Command/CheckPresentKey.hs')
-rw-r--r--Command/CheckPresentKey.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/Command/CheckPresentKey.hs b/Command/CheckPresentKey.hs
index 4f9b4b120..6d172b68e 100644
--- a/Command/CheckPresentKey.hs
+++ b/Command/CheckPresentKey.hs
@@ -52,12 +52,10 @@ check ks mr = case mr of
k = toKey ks
go Nothing [] = return NotPresent
go (Just e) [] = return $ CheckFailure e
- go olderr (r:rs) = do
- v <- Remote.hasKey r k
- case v of
- Right True -> return Present
- Right False -> go olderr rs
- Left e -> go (Just e) rs
+ go olderr (r:rs) = Remote.hasKey r k >>= \case
+ Right True -> return Present
+ Right False -> go olderr rs
+ Left e -> go (Just e) rs
exitResult :: Result -> Annex a
exitResult Present = liftIO exitSuccess