more lambda-case conversion

This commit is contained in:
Joey Hess 2017-12-05 15:00:50 -04:00
parent 936d50310d
commit fc845e6530
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
29 changed files with 137 additions and 199 deletions

View file

@ -103,15 +103,13 @@ checkDeadRepo u =
earlyWarning "Warning: Fscking a repository that is currently marked as dead."
start :: Maybe Remote -> Incremental -> FilePath -> Key -> CommandStart
start from inc file key = do
v <- Backend.getBackend file key
case v of
Nothing -> stop
Just backend -> do
numcopies <- getFileNumCopies file
case from of
Nothing -> go $ perform key file backend numcopies
Just r -> go $ performRemote key afile backend numcopies r
start from inc file key = Backend.getBackend file key >>= \case
Nothing -> stop
Just backend -> do
numcopies <- getFileNumCopies file
case from of
Nothing -> go $ perform key file backend numcopies
Just r -> go $ performRemote key afile backend numcopies r
where
go = runFsck inc (mkActionItem afile) key
afile = AssociatedFile (Just file)
@ -142,9 +140,8 @@ performRemote key afile backend numcopies remote =
dispatch (Left err) = do
showNote err
return False
dispatch (Right True) = withtmp $ \tmpfile -> do
r <- getfile tmpfile
case r of
dispatch (Right True) = withtmp $ \tmpfile ->
getfile tmpfile >>= \case
Nothing -> go True Nothing
Just True -> go True (Just tmpfile)
Just False -> do