diff options
author | 2017-12-05 15:00:50 -0400 | |
---|---|---|
committer | 2017-12-05 15:00:50 -0400 | |
commit | 236c467da19f34edb08f124e37fd26eb62c43fcf (patch) | |
tree | f4e488f77fb954812e4d48f399fc2ecab072afea /Command/Add.hs | |
parent | f013f71cb5d3f7eee3afb3eb8f01a33206d717c4 (diff) |
more lambda-case conversion
Diffstat (limited to 'Command/Add.hs')
-rw-r--r-- | Command/Add.hs | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/Command/Add.hs b/Command/Add.hs index d1b2fbc7d..638da101e 100644 --- a/Command/Add.hs +++ b/Command/Add.hs @@ -98,31 +98,25 @@ start file = do ) where go = ifAnnexed file addpresent add - add = do - ms <- liftIO $ catchMaybeIO $ getSymbolicLinkStatus file - case ms of - Nothing -> stop - Just s - | not (isRegularFile s) && not (isSymbolicLink s) -> stop - | otherwise -> do - showStart "add" file - next $ if isSymbolicLink s - then next $ addFile file - else perform file + add = liftIO (catchMaybeIO $ getSymbolicLinkStatus file) >>= \case + Nothing -> stop + Just s + | not (isRegularFile s) && not (isSymbolicLink s) -> stop + | otherwise -> do + showStart "add" file + next $ if isSymbolicLink s + then next $ addFile file + else perform file addpresent key = ifM versionSupportsUnlockedPointers - ( do - ms <- liftIO $ catchMaybeIO $ getSymbolicLinkStatus file - case ms of - Just s | isSymbolicLink s -> fixuplink key - _ -> ifM (sameInodeCache file =<< Database.Keys.getInodeCaches key) - ( stop, add ) + ( liftIO (catchMaybeIO $ getSymbolicLinkStatus file) >>= \case + Just s | isSymbolicLink s -> fixuplink key + _ -> ifM (sameInodeCache file =<< Database.Keys.getInodeCaches key) + ( stop, add ) , ifM isDirect - ( do - ms <- liftIO $ catchMaybeIO $ getSymbolicLinkStatus file - case ms of - Just s | isSymbolicLink s -> fixuplink key - _ -> ifM (goodContent key file) - ( stop , add ) + ( liftIO (catchMaybeIO $ getSymbolicLinkStatus file) >>= \case + Just s | isSymbolicLink s -> fixuplink key + _ -> ifM (goodContent key file) + ( stop , add ) , fixuplink key ) ) |