I've hacked together some code to read the content from a sequence of files:let fileContents =     [ filename1; filename2; etc ]    |> Seq.map(fun file -> async {        use fs = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.Read)        let data = Array.create(int fs.Length) 0uy        let! _ = fs.AsyncRead(data, 0, data.Length)        return data             })    |> Async.Parallel     |> Async.RunSynchronously    |> Seq.map System.Text.Encoding.ASCII.GetStringIt works, but I'm not really sure about it. For one thing, is async actually giving me any benefit here? Also inside the async function I need to wait for AsyncRead to finish, but I don't need the returned value from it. Is there a better way of doing this than let! _ = ...?
Is this a good use of Async in F#?
asynchronous;f#;concurrency
You can take advantage of async to do parallel IO which Async.Parallel makes very easy. Also, when you don't need the return value of an async call you can use Async.ignore in combination with do!: do! fs.AsyncRead(data, 0, data.Length) |> Async.ignoreHowever this specific snipper can be made much simpler since there is no reason to await the result of the computations when using Async.Parallel:open System.IOlet fileContents =     [ filename1; filename2; etc ]    |> List.map(fun file -> async { use fs = File.OpenRead(file) in return! fs.AsyncRead(fs.Length |> int)})    |> Async.Parallel     |> Async.RunSynchronously    |> Seq.map System.Text.Encoding.ASCII.GetStringOne caveat - if the size of your file is more than 2GB it won't work due to long->int conversion - but that would be a crazy big file to just read the content of like that :-D