-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b637d1
commit 7266305
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Bind Mappings | ||
|
||
This pages shows you which computation expressions can implicitly bind to other CEs | ||
|
||
Example | ||
|
||
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. | ||
|
||
```fsharp | ||
asyncOption { | ||
let! x = Some 1 | ||
return x | ||
} | ||
``` | ||
|
||
*Each CE can bind to itself so we don't list that here to reduce redundancy* | ||
|
||
| CE | Can Bind (FsToolkit.ErrorHandling) | Can Bind (FsToolkit.ErrorHandling.IcedTasks) | Can Bind (FsToolkit.ErrorHandling.JobResult) | Can Bind (FsToolkit.ErrorHandling.TaskResult) | | ||
|:--------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------|--|-----------------------------------------------| | ||
| AsyncOption | Async, Task, Option | || | | ||
| AsyncResult | Result, Choice, Async, Task | || TaskResult | | ||
| AsyncResultOption | AsyncResult, AsyncOption, Result, Choice, Async, Task, Option | || TaskResultOption, TaskResult, TaskOption | | ||
| AsyncValidation | AsyncResult, Validation, Result, Choice, Async | || | | ||
| CancellableTaskResult | AsyncResult, AsyncChoice, Result, Choice, Async, Task, | CancellableTask<sup>1</sup>, ColdTask<sup>4</sup> || ValueTaskResult, TaskResult | | ||
| CancellableTaskValidation | AsyncResult, AsyncChoice, ValueTaskResult<sup>3</sup>, TaskResult<sup>3</sup>, Validation, Result, Choice, Async, Task, CancellableTask<sup>1</sup>, ColdTask<sup>4</sup> | || | | ||
| JopOption | Job <sup>2</sup>, TaskOption <sup>3</sup>, AsyncOption | || | | ||
| JobResult | | || | | ||
| JobResultOption | | || | | ||
| Option | | || | | ||
| Result | | || | | ||
| ResultOption | | || | | ||
| Task | | || | | ||
| TaskOption | | || | | ||
| TaskResult | | || | | ||
| TaskResultOption | | || | | ||
| Validation | | || | |