You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been moving some code from Taskbuilder.fs to Ply and I've noticed an odd compilation error.
It seems that when the type of an expression unwrapped with let! is unspecified, it is always inferred as Ply<'t>.
Naturally, if I'm not using the uply builder, that's unlikely to be the default that I want, especially since it's an "unsafe" builder.
I'm much more likely to be composing the same kind of CE all the way through. But then I get a compile error at the call site because the let! expects a Ply<_> unless explicitly annotated.
Would it be possible to make each builder choose its own type as the default inference target for let! and other unwrappings?
Minimal repro
openFSharp.Control.TaskslethigherOrderTask t =task{let!result= t()return result +"_1"}letsomeTask()= System.IO.File.ReadAllTextAsync("/somePath")letinstance= higherOrderTask someTask
(* someTask: Type mismatch. Expecting a 'unit -> Ply.Ply<string>' but given a 'unit -> Task<string>'*)
Current workaround:
let!result=(t(): Task<_>)
The text was updated successfully, but these errors were encountered:
I've been moving some code from Taskbuilder.fs to Ply and I've noticed an odd compilation error.
It seems that when the type of an expression unwrapped with
let!
is unspecified, it is always inferred asPly<'t>
.Naturally, if I'm not using the
uply
builder, that's unlikely to be the default that I want, especially since it's an "unsafe" builder.I'm much more likely to be composing the same kind of CE all the way through. But then I get a compile error at the call site because the
let!
expects aPly<_>
unless explicitly annotated.Would it be possible to make each builder choose its own type as the default inference target for
let!
and other unwrappings?Minimal repro
Current workaround:
The text was updated successfully, but these errors were encountered: