Skip to content

Instantly share code, notes, and snippets.

@mattcanty
Created May 29, 2015 16:05
Show Gist options
  • Save mattcanty/0437fad1999fd39d95f6 to your computer and use it in GitHub Desktop.
Save mattcanty/0437fad1999fd39d95f6 to your computer and use it in GitHub Desktop.
F# Retry Loop
let rec retry times fn =
if times > 1 then
try
fn()
with
| _ -> retry (times - 1) fn
else
fn()
//Source @gradbot on Stack Overflow http://stackoverflow.com/a/5942170/966609
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment