|
| 1 | +# Bind Mappings |
| 2 | + |
| 3 | +This pages shows you which computation expressions can implicitly bind to other CEs |
| 4 | + |
| 5 | +Example |
| 6 | + |
| 7 | +Here we can bind an 'T Option to 'T AsyncOption without having to lift from one type to another. See [here](https://fsharpforfunandprofit.com/posts/elevated-world/) for a better understanding on 'lifting'. To associate with the table below, the AsyncOption is the CE and the Option is the CE that can bind to it. |
| 8 | + |
| 9 | +```fsharp |
| 10 | +asyncOption { |
| 11 | + let! x = Some 1 |
| 12 | + return x |
| 13 | +} |
| 14 | +``` |
| 15 | + |
| 16 | +*Each CE can bind to itself so we don't list that here to reduce redundancy* |
| 17 | + |
| 18 | +| CE | Can Bind (FsToolkit.ErrorHandling) | Can Bind (FsToolkit.ErrorHandling.IcedTasks) | Can Bind (FsToolkit.ErrorHandling.JobResult) | Can Bind (FsToolkit.ErrorHandling.TaskResult) | |
| 19 | +|:--------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------|--|-----------------------------------------------| |
| 20 | +| AsyncOption | Async, Task, Option | || | |
| 21 | +| AsyncResult | Result, Choice, Async, Task | || TaskResult | |
| 22 | +| AsyncResultOption | AsyncResult, AsyncOption, Result, Choice, Async, Task, Option | || TaskResultOption, TaskResult, TaskOption | |
| 23 | +| AsyncValidation | AsyncResult, Validation, Result, Choice, Async | || | |
| 24 | +| CancellableTaskResult | AsyncResult, AsyncChoice, Result, Choice, Async, Task, | CancellableTask<sup>1</sup>, ColdTask<sup>4</sup> || ValueTaskResult, TaskResult | |
| 25 | +| CancellableTaskValidation | AsyncResult, AsyncChoice, ValueTaskResult<sup>3</sup>, TaskResult<sup>3</sup>, Validation, Result, Choice, Async, Task, CancellableTask<sup>1</sup>, ColdTask<sup>4</sup> | || | |
| 26 | +| JopOption | Job <sup>2</sup>, TaskOption <sup>3</sup>, AsyncOption | || | |
| 27 | +| JobResult | | || | |
| 28 | +| JobResultOption | | || | |
| 29 | +| Option | | || | |
| 30 | +| Result | | || | |
| 31 | +| ResultOption | | || | |
| 32 | +| Task | | || | |
| 33 | +| TaskOption | | || | |
| 34 | +| TaskResult | | || | |
| 35 | +| TaskResultOption | | || | |
| 36 | +| Validation | | || | |
0 commit comments