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 Microsoft.FSharp.Reflection | |
let readln = Console.ReadLine | |
let writeln = fun a -> | |
let args = if FSharpType.IsTuple(a.GetType()) then FSharpValue.GetTupleFields(a) else [|a|] | |
let fmt = args |> Array.indexed |> Array.fold (fun s e -> s + (sprintf "{%d}" (fst e))) "" | |
Console.WriteLine(fmt.Trim(), args) | |
let write = fun a -> | |
let args = if FSharpType.IsTuple(a.GetType()) then FSharpValue.GetTupleFields(a) else [|a|] |
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.IO | |
open System.Net | |
open System.Text | |
open System | |
let httpAsync (progress : IProgress<string>) (url : string) = async { | |
let req = System.Net.WebRequest.Create(url) | |
use! resp = req.AsyncGetResponse() | |
progress.Report(sprintf "%s AsyncGetResponse" url) | |
use stream = resp.GetResponseStream() |
NewerOlder