{"action":"created","issue":{"url":"https://api.github.com/repos/commercialhaskell/stack/issues/560","labels_url":"https://api.github.com/repos/commercialhaskell/stack/issues/560/labels{/name}","comments_url":"https://api.github.com/repos/commercialhaskell/stack/issues/560/comments","events_url":"https://api.github.com/repos/commercialhaskell/stack/issues/560/events","html_url":"https://github.com/commercialhaskell/stack/pull/560","id":94354574,"number":560,"title":"Use `retry` package for download retry logic","user":{"login":"markus1189","id":591567,"avatar_url":"https://avatars.githubusercontent.com/u/591567?v=3","gravatar_id":"","url":"https://api.github.com/users/markus1189","html_url":"https://github.com/markus1189","followers_url":"https://api.github.com/users/markus1189/followers","following_url":"https://api.github.com/users/markus1189/following{/other_user}","gists_url":"https://api.github.com/users/markus1189/gists{/gist_id}","starred_url":"https://api.github.com/users/markus1189/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markus1189/subscriptions","organizations_url":"https://api.github.com/users/markus1189/orgs","repos_url":"https://api.github.com/users/markus1189/repos","events_url":"https://api.github.com/users/markus1189/events{/privacy}","received_events_url":"https://api.github.com/users/markus1189/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-07-10T17:37:38Z","updated_at":"2015-07-21T08:17:44Z","closed_at":"2015-07-13T07:16:59Z","pull_request":{"url":"https://api.github.com/repos/commercialhaskell/stack/pulls/560","html_url":"https://github.com/commercialhaskell/stack/pull/560","diff_url":"https://github.com/commercialhaskell/stack/pull/560.diff","patch_url":"https://github.com/commercialhaskell/stack/pull/560.patch"},"body":"I hope @DanBurton doesn't mind me stealing his todos ;)\r\n\r\nBackground: I saw the todo in `Network.HTTP.Download.Verified`:\r\n```\r\n-- TODO(DanBurton): use Control.Retry instead.\r\n```\r\nand I didn't know that package but I also had some personal code where I went with the custom `retry` function approach so I was curious about `Control.Retry`.  Turns out the `retry` package is pretty nice!\r\n\r\nChanges:\r\n1. add dependency on `retry >= 0.6` because the retry policy was improved starting with 0.6\r\n2. replace the custom retry function with [Control.Retry.recovering](http://hackage.haskell.org/package/retry-0.6/docs/Control-Retry.html#v:recovering), using `limitRetries 3` as policy, so no delay (**do we want delay?**)\r\n3. **remove the `ZeroRetries` constructor from `VerifiedDownloadException`**\r\n\r\nThe semantics of the old `retry` function should be kept, e.g. the last exception is rethrown by `recovering` if all retries fail.\r\n\r\nMy understanding of 3.:\r\nThe `ZeroRetries` case was meant to be used in case the number of retries is <= 0.  But from my point of view that is not a problem even if it is negative: that just means we won't *retry* the action at all.  Due to this reasoning I just removed it completely. If I got anything wrong please correct me here."},"comment":{"url":"https://api.github.com/repos/commercialhaskell/stack/issues/comments/123209571","html_url":"https://github.com/commercialhaskell/stack/pull/560#issuecomment-123209571","issue_url":"https://api.github.com/repos/commercialhaskell/stack/issues/560","id":123209571,"user":{"login":"markus1189","id":591567,"avatar_url":"https://avatars.githubusercontent.com/u/591567?v=3","gravatar_id":"","url":"https://api.github.com/users/markus1189","html_url":"https://github.com/markus1189","followers_url":"https://api.github.com/users/markus1189/followers","following_url":"https://api.github.com/users/markus1189/following{/other_user}","gists_url":"https://api.github.com/users/markus1189/gists{/gist_id}","starred_url":"https://api.github.com/users/markus1189/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markus1189/subscriptions","organizations_url":"https://api.github.com/users/markus1189/orgs","repos_url":"https://api.github.com/users/markus1189/repos","events_url":"https://api.github.com/users/markus1189/events{/privacy}","received_events_url":"https://api.github.com/users/markus1189/received_events","type":"User","site_admin":false},"created_at":"2015-07-21T08:17:44Z","updated_at":"2015-07-21T08:17:44Z","body":"Okay I don't know what happened here, but I just noticed that it's not yet in `master`.  Really strange I can't remember why I would close this pr, anything I forgot?"}}