Created
September 13, 2012 19:47
-
-
Save dungpa/3717085 to your computer and use it in GitHub Desktop.
Common mistake
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
async { | |
let wc = new WebClient() | |
let html = wc.DownloadString(uri) | |
printfn "%s" html } | |
// To make code in F# async workflow actually asynchronous, | |
// we need to use a primitive operation of type Async<'T> | |
// (implemented usually in the F# library as an extension) and call it using let! or do!: | |
async { | |
let wc = new WebClient() | |
let! html = wc.AsyncDownloadString(uri) // Asynchronous call here! | |
printfn "%s" html } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment