Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
F# async worflow example
open System.IO
open System.Net
open System.Text
async {
let file = File.OpenRead("Program.fs")
let! stuff = file.AsyncRead(250)
printfn "%A" (Encoding.Default.GetString(stuff))
let req = WebRequest.Create("")
let! resp = req.AsyncGetResponse()
printfn "%i headers recieved." resp.Headers.Count
} |> Async.RunSynchronously
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.