summaryrefslogtreecommitdiff
path: root/Remote
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-08-28 15:46:49 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-08-28 15:46:49 -0400
commit999d5df90b013a7cc8a390c940785118400faf8a (patch)
tree82b9e2ab8c00e32f88c5878b06b1301413b51e53 /Remote
parentb26ee162f33858aa4ef82fbe3d56eecc00590755 (diff)
factor out firstM and anyM
Control.Monad.Loops has these, but has no Debian package yet.
Diffstat (limited to 'Remote')
-rw-r--r--Remote/Web.hs7
1 files changed, 2 insertions, 5 deletions
diff --git a/Remote/Web.hs b/Remote/Web.hs
index 0e4b75767..3695bb1ab 100644
--- a/Remote/Web.hs
+++ b/Remote/Web.hs
@@ -24,6 +24,7 @@ import Config
import PresenceLog
import LocationLog
import Locations
+import Utility
import qualified Utility.Url as Url
type URLString = String
@@ -91,11 +92,7 @@ downloadKey key file = get =<< getUrls key
get [] = do
warning "no known url"
return False
- get a = iter a
- iter [] = return False
- iter (url:urls) = do
- ok <- Url.download url file
- if ok then return ok else iter urls
+ get urls = anyM (`Url.download` file) urls
uploadKey :: Key -> Annex Bool
uploadKey _ = do