I suggest we ...

Support bind (e.g. "await") in the middle of expressions, possibly using !! operator

that does the binding implicitly; so that it wouldn't be necessary to bind every monadic expression to a name. In the case of async workflows, it would behave like the C# await keyword.
With this operator, instead of this:
let task= tasync{
let! response = http.GetAsync(uri)
let! string = response.Content.ReadAsStringAsync()
let! res = processAsync(string)
return res
}
it would be possible to write code like this:
let task= tasync{ return !! processAsync(!!(!!http.GetAsync(uri)).Content.ReadAsStringAsync()) }

Or write this:
let t= opt{ return ((!!x) + !!y) / !!z}
instead of this:
let t= opt{
let! xx = x
let! yy = y
let! zz = z
return (xx + yy) / zz
}

10 votes
Vote
Sign in
(thinking…)
Sign in with: Facebook Google
Signed in as (Sign out)
You have left! (?) (thinking…)
Arash Sahebolamri shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

2 comments

Sign in
(thinking…)
Sign in with: Facebook Google
Signed in as (Sign out)
Submitting...

F# Language

Feedback and Knowledge Base