Skip to content

Instantly share code, notes, and snippets.

@alexyakunin
Last active October 6, 2015 01:56
Show Gist options
  • Save alexyakunin/da1251fe4e39f5f90fc3 to your computer and use it in GitHub Desktop.
Save alexyakunin/da1251fe4e39f5f90fc3 to your computer and use it in GitHub Desktop.
open System.Threading
let rec countRecursivelyAsync count = async {
if count <= 0 then
return count
else
let! result = countRecursivelyAsync(count - 1)
return result + 1
}
[<EntryPoint>]
let main argv =
let result = countRecursivelyAsync 10000 |> Async.RunSynchronously
printfn "Counted to %d." result
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment