Last active
August 29, 2015 14:15
-
-
Save kjnilsson/d22beedd080aeee141f0 to your computer and use it in GitHub Desktop.
FSharp recursive async fuction [Non leaking] + Closure representation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[<EntryPoint>] | |
let main argv = | |
let rec loop () = async { | |
do! Async.Sleep 10 | |
return! loop () } | |
Async.Start <| loop () | |
System.Console.ReadLine() |> ignore | |
0 | |
(* compled representations of loop | |
loop@4-1<a> | |
loop: Microsoft.FSharp.Core.FSharpTypeFunc | |
builder@: Microsoft.FSharp.Control.FSharpAsyncBuilder | |
loop@5-2<a> | |
loop: Microsoft.FSharp.Core.FSharpTypeFunc | |
builder@: Microsoft.FSharp.Control.FSharpAsyncBuilder | |
*) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment