Skip to content

Instantly share code, notes, and snippets.

@chaliy
Created March 24, 2013 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chaliy/5232828 to your computer and use it in GitHub Desktop.
Save chaliy/5232828 to your computer and use it in GitHub Desktop.
F# async does not support .NET TPL async
open System
open System.Net
let download(url : string) =
async {
let client = new WebClient()
let! html = client.DownloadStringTaskAsync(url)
return html
}
[<EntryPoint>]
let main argv =
let html =
download("http://example.com")
|> Async.RunSynchronously
0
// This expression was expected to have type Async<'a> but here has type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment