Created
March 24, 2013 17:51
-
-
Save chaliy/5232828 to your computer and use it in GitHub Desktop.
F# async does not support .NET TPL async
This file contains hidden or 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
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
See https://github.com/fsharp/fsharpx/blob/master/tests/FSharpx.Tests/TaskTests.fs