Posted by @TheAngryByrd on the Discord channel:
First you must learn a bit about computation expressions:
- Computation Expressions - F# | Microsoft Learn
- Computation expressions: Introduction | F# for fun and profit
- Computation Expression Stub for F# · GitHub
- F# Computation Expression Method Overload Resolution Ordering · GitHub
Then you probably need to learn a bit about the C# async state machine generation:
- https://www.youtube.com/watch?v=_hZ8rk_effg
- https://devblogs.microsoft.com/dotnet/how-async-await-really-works/
Then you can read the RFC and community discussions around it:
- fslang-design/FSharp-6.0/FS-1087-resumable-code.md at main · fsharp/fslang-design · GitHub
- https://www.youtube.com/watch?v=GYi3ZMF8Pm0
- https://www.youtube.com/watch?v=B6m_vJ-a2dM
See some code implementing it:
- fsharp/src/FSharp.Core/tasks.fs at main · dotnet/fsharp · GitHub
- fsharp/tests/benchmarks/CompiledCodeBenchmarks/TaskPerf/TaskPerf at main · dotnet/fsharp · GitHub
- GitHub - TheAngryByrd/IcedTasks: F# Cold Tasks and Cancellable Tasks
- https://www.youtube.com/watch?v=BIoBvsr19GU
- GitHub - fsprojects/FSharp.Control.TaskSeq: A computation expression and module for seamless working with IAsyncEnumerable<'T> as if it is just another sequence