I am new to programming and F# is my first .NET language.
Here is some code I have written so far:
let downloadFromWebsite (url: string) =
async {
let uri = new System.Uri(url)
let webClient = new WebClient()
let! html = webClient.AsyncDownloadString(uri)
printfn "Read %d characters from %s" html.Length url
return html
}
let results = downloadFromWebsite @"http://plato.stanford.edu"
printf "%s" results
Here is the error message:
~vs8222.fsx(19,13): error FS0001: This expression was expected to have type string but here has type Async
What went wrong? What changes should I make?