summaryrefslogtreecommitdiff
path: root/Annex/LockPool
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-11-15 16:55:38 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-11-15 16:59:32 -0400
commit4888bd597e34dce996fd581bb417ce017099171b (patch)
tree8b97f6807b5528be6b00c8d21038057ca097ec29 /Annex/LockPool
parent01c524779136a688abf312e721abce41d2dd109c (diff)
enable LambdaCase and convert around 10% of places that could use it
Needs ghc 7.6.1, so minimum base version increased slightly. All builds are well above this version of ghc, and debian oldstable is as well. Code that could use lambdacase can be found by running: git grep -B 1 'case ' | less and searching in less for "<-" This commit was sponsored by andrea rota.
Diffstat (limited to 'Annex/LockPool')
-rw-r--r--Annex/LockPool/PosixOrPid.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/Annex/LockPool/PosixOrPid.hs b/Annex/LockPool/PosixOrPid.hs
index c788f6fa0..47d2e5144 100644
--- a/Annex/LockPool/PosixOrPid.hs
+++ b/Annex/LockPool/PosixOrPid.hs
@@ -49,12 +49,10 @@ tryLockExclusive m f = tryPidLock m f $ Posix.tryLockExclusive m f
checkLocked :: LockFile -> Annex (Maybe Bool)
checkLocked f = Posix.checkLocked f `pidLockCheck` checkpid
where
- checkpid pidlock = do
- v <- Pid.checkLocked pidlock
- case v of
- -- Only return true when the posix lock file exists.
- Just _ -> Posix.checkLocked f
- Nothing -> return Nothing
+ checkpid pidlock = Pid.checkLocked pidlock >>= \case
+ -- Only return true when the posix lock file exists.
+ Just _ -> Posix.checkLocked f
+ Nothing -> return Nothing
getLockStatus :: LockFile -> Annex LockStatus
getLockStatus f = Posix.getLockStatus f