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
{{ message }}
Repository navigation
Add/use shim versions of FSharp.Core Async and Task modules? #372
Now that fsharp/fslang-suggestions#1466fsharp/fslang-suggestions#1467 have made it to fsharp/main, I'm wondering if it might make sense to put poor man's versions of the impls in as shims and then have net11.0 builds use the in the box ones?
Thinking e.g. having clones of Async.Await, Task.parallelLimit in the box conditionally compiled in for <= net11.0 and making the libs internal calls use Async.Await, Async.catch and friends to the max degree possible (which would fix longstanding issues on this lib yielding AggregateException etc.
Or is there a point where the lib simply takes a hard net11 / net12 dependency? (Yes I could search, but more trying to get a quick take from you - I'm not literally as bored as the question might make me seem!)
changed the title [-]Add shim versions of FSharp.Core Async and Task modules and use same?[/-][+]Add/use shim versions of FSharp.Core Async and Task modules?[/+]on Sep 8, 2026
TL;DR which branch/version should a PR target considering I don't personally need it yet and this becomes of minor interest in F#11 release timeframe and major interest in F#12 timeframe. At that point, I can imagine/hope that FSharp.Core will have Async+Task.map2,map3,zip so there may be more than one set of ifdefs (i.e. map gets relegated to a shim when targeting net11.0 and map2 and map3 join it for net12.0).
which branch/version should a PR target, considering
We're still in beta for 6.0 so just target master and we can add all these shims.
does an obsoleted edition under the old name stay alongside or not
It does suck to have binary incompatibilities because people like one name over another any given year. Because this is such a utilized library, I hate making people either be stuck with older versions if they have conflicts or forcing other libraries to update. I'd probably prefer keeping it and sticking whatever Deprecated/Obsolete attribute Microsoft prefers nowadays.
Hm well hard choices need to be made for .singleton esp wrt Async/Task/ValueTask (but then logically same for Job/*ResultOption etc)
I think if we can shim it to provide result universally, then its a win to obsolete result
But, there is a question as to whether you then document result in the gitbook or let people not targeting FSharp.Core 11.0 work out why they have it despite in not being in the docs
Ultimately being able to remove docs for empty, result/singleton, map, bind, catch, ignore enhances the value of the docs a lot from my perspective?
So Task.catch... the FSharp.Core one returns Result.
Async.Catch will continue to exist alongside Async.catch with the old signature.
For net>=10 I can ifdef it out.
But for older ones, I guess the breaking change should be considered? Having something in a common namespace that hides the one everyone will eventually know/use is annoying?
Another thorny one: Result.valueOr duplicates defaultWith and assume we'd hence want to remove it from the lib and the docs - how do you deal with that?
obsolete it in 6.x beta and remove in 7?
already remove it from net10/net11 builds in 6.x on the grounds that there is no binary compatibility needed with something that didnt exist?
=> I marked it obsolete and compiled it out on net10
For Result.map, which has been in FSharp.Core since 6.0 (along with bind and one or two others), there's a different question
I guess >=net10 (i.e. newly supported TFMs) can omit it and docs can remove it (and the less functions in the docs the better)
for other TFMs, making it BrowserVisible false presumably wont affect the fact that if you open FsToolkit.ErrorHandling the shadowing one will win? and you can't mark it obsolete as there's no easy way to 'correct' the call site using it?
=>I guess it stays in pre net10.0; But I think it should get removed from the docs along with bind etc?
Activity
[-]Add shim versions of FSharp.Core Async and Task modules and use same?[/-][+]Add/use shim versions of FSharp.Core Async and Task modules?[/+]TheAngryByrd commentedon Sep 9, 2026
I think this makes sense.
We already do have the mechanisms for progressive dependency adding so adding F# 11/12 here and adding ifdefs would work.
bartelink commentedon Sep 10, 2026
TL;DR which branch/version should a PR target considering I don't personally need it yet and this becomes of minor interest in F#11 release timeframe and major interest in F#12 timeframe. At that point, I can imagine/hope that FSharp.Core will have Async+Task.map2,map3,zip so there may be more than one set of ifdefs (i.e. map gets relegated to a shim when targeting net11.0 and map2 and map3 join it for net12.0).
Questions
resultresultshim for <net11.0builds?bind,mapget added in FSharp.Core 11, to what branch do I add conditional compiling out for >=net11.0buildsmaxDegreeOfParallelismarg add here in parallelMap. Could I remove it?TheAngryByrd commentedon Sep 11, 2026
We're still in beta for 6.0 so just target
masterand we can add all these shims.It does suck to have binary incompatibilities because people like one name over another any given year. Because this is such a utilized library, I hate making people either be stuck with older versions if they have conflicts or forcing other libraries to update. I'd probably prefer keeping it and sticking whatever Deprecated/Obsolete attribute Microsoft prefers nowadays.
Might have been a sloptimization assuming it would allocate less. No preference.
bartelink commentedon Sep 11, 2026
Hm well hard choices need to be made for
.singletonesp wrt Async/Task/ValueTask (but then logically same for Job/*ResultOption etc)I think if we can shim it to provide result universally, then its a win to obsolete
resultBut, there is a question as to whether you then document
resultin the gitbook or let people not targeting FSharp.Core 11.0 work out why they have it despite in not being in the docsUltimately being able to remove docs for empty, result/singleton, map, bind, catch, ignore enhances the value of the docs a lot from my perspective?
So Task.catch... the FSharp.Core one returns Result.
Another thorny one:
Result.valueOrduplicates defaultWith and assume we'd hence want to remove it from the lib and the docs - how do you deal with that?=> I marked it obsolete and compiled it out on net10
For
Result.map, which has been in FSharp.Core since 6.0 (along with bind and one or two others), there's a different questionBrowserVisible falsepresumably wont affect the fact that if youopen FsToolkit.ErrorHandlingthe shadowing one will win? and you can't mark it obsolete as there's no easy way to 'correct' the call site using it?=>I guess it stays in pre net10.0; But I think it should get removed from the docs along with bind etc?
Will add more as I run into them...