summaryrefslogtreecommitdiff
path: root/Assistant/Drop.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-31 02:34:03 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-31 02:34:03 -0400
commitacec36711090577752532a39f472e734e6b67fdb (patch)
tree6a3a5de0ec092e19c28464f4e2703fda9571b264 /Assistant/Drop.hs
parent661eda766a8aa5c548ad89d8360bd4219eea138b (diff)
where indentation
Diffstat (limited to 'Assistant/Drop.hs')
-rw-r--r--Assistant/Drop.hs45
1 files changed, 22 insertions, 23 deletions
diff --git a/Assistant/Drop.hs b/Assistant/Drop.hs
index ed9ba577e..a02f58652 100644
--- a/Assistant/Drop.hs
+++ b/Assistant/Drop.hs
@@ -37,30 +37,29 @@ handleDrops' locs rs fromhere key (Just f)
then go rs =<< dropl n
else go rs n
| otherwise = go rs =<< getcopies
- where
- getcopies = do
- have <- length . snd <$> trustPartition UnTrusted locs
- numcopies <- getNumCopies =<< numCopies f
- return (have, numcopies)
- checkcopies (have, numcopies) = have > numcopies
- decrcopies (have, numcopies) = (have - 1, numcopies)
+ where
+ getcopies = do
+ have <- length . snd <$> trustPartition UnTrusted locs
+ numcopies <- getNumCopies =<< numCopies f
+ return (have, numcopies)
+ checkcopies (have, numcopies) = have > numcopies
+ decrcopies (have, numcopies) = (have - 1, numcopies)
- go [] _ = noop
- go (r:rest) n
- | checkcopies n = dropr r n >>= go rest
- | otherwise = noop
+ go [] _ = noop
+ go (r:rest) n
+ | checkcopies n = dropr r n >>= go rest
+ | otherwise = noop
- checkdrop n@(_, numcopies) u a =
- ifM (wantDrop u (Just f))
- ( ifM (doCommand $ a (Just numcopies))
- ( return $ decrcopies n
- , return n
- )
- , return n
- )
+ checkdrop n@(_, numcopies) u a = ifM (wantDrop u (Just f))
+ ( ifM (doCommand $ a (Just numcopies))
+ ( return $ decrcopies n
+ , return n
+ )
+ , return n
+ )
- dropl n = checkdrop n Nothing $ \numcopies ->
- Command.Drop.startLocal f numcopies key
+ dropl n = checkdrop n Nothing $ \numcopies ->
+ Command.Drop.startLocal f numcopies key
- dropr r n = checkdrop n (Just $ Remote.uuid r) $ \numcopies ->
- Command.Drop.startRemote f numcopies key r
+ dropr r n = checkdrop n (Just $ Remote.uuid r) $ \numcopies ->
+ Command.Drop.startRemote f numcopies key r