TheAngryByrd / IcedTasks

F# Cold Tasks and Cancellable Tasks
https://www.jimmybyrd.me/IcedTasks/
MIT License
120 stars 5 forks source link

Reusable MethodBuilder/TaskBase #34

Closed TheAngryByrd closed 8 months ago

TheAngryByrd commented 8 months ago

Proposed Changes

This is a major refactoring of the codebase. I was getting annoyed having to create extremely large files for small variants in MethodBuilders:

With this large refactor we've been able to only need to implement the Run methods and inherit from a base class. Additional implementations of MergeSources and Source for type inference.

With that we have a few new CEs:

Also I've added a Polyfill namespace for fixing things in FSharp.Core that haven't made it upstream such as #31/https://github.com/dotnet/fsharp/issues/16189. You can open IcedTasks.Polyfill to shadow usages of task { }

Removed backgroundValueTask variants as they made no sense to actually have.

I'm also testing some Dynamic and Background implementations but not all of them.

Types of changes

What types of changes does your code introduce to IcedTasks? Put an x in the boxes that apply

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...