diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-05-23 18:47:30 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-05-23 18:47:30 -0400 |
commit | 622b379d132c1c6e329d19fe6cb6486fe1335047 (patch) | |
tree | 75dcf90c6716cafcac631a4fde2635aca95781ce /Remote/Bup.hs | |
parent | 5215c82ccbc91a2d6a7329ba444472695bec52a1 (diff) |
improved refactoring
ghc 8.0.1 didn't like runner because it used Rank2Types or something.
Instead, factor out the feeder action.
Diffstat (limited to 'Remote/Bup.hs')
-rw-r--r-- | Remote/Bup.hs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/Remote/Bup.hs b/Remote/Bup.hs index 06cce3d39..22510859c 100644 --- a/Remote/Bup.hs +++ b/Remote/Bup.hs @@ -133,13 +133,12 @@ store r buprepo = byteStorer $ \k b p -> do showOutput -- make way for bup output let cmd = proc "bup" (toCommand params) quiet <- commandProgressDisabled - if quiet - then liftIO $ feedWithQuietOutput createProcessSuccess cmd $ \h -> do - meteredWrite p h b - return True - else liftIO $ withHandle StdinHandle createProcessSuccess cmd $ \h -> do - meteredWrite p h b - return True + let feeder = \h -> do + meteredWrite p h b + return True + liftIO $ if quiet + then feedWithQuietOutput createProcessSuccess cmd feeder + else withHandle StdinHandle createProcessSuccess cmd feeder retrieve :: BupRepo -> Retriever retrieve buprepo = byteRetriever $ \k sink -> do |