From 726630571d176c393acf0e564d2bdeac43778097 Mon Sep 17 00:00:00 2001 From: 1eyewonder Date: Fri, 7 Jul 2023 22:03:15 -0500 Subject: [PATCH] WIP document --- gitbook/BindMappings.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 gitbook/BindMappings.md diff --git a/gitbook/BindMappings.md b/gitbook/BindMappings.md new file mode 100644 index 00000000..f3d8cd83 --- /dev/null +++ b/gitbook/BindMappings.md @@ -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, | CancellableTask1, ColdTask4 || ValueTaskResult, TaskResult | +| CancellableTaskValidation | AsyncResult, AsyncChoice, ValueTaskResult3, TaskResult3, Validation, Result, Choice, Async, Task, CancellableTask1, ColdTask4 | || | +| JopOption | Job 2, TaskOption 3, AsyncOption | || | +| JobResult | | || | +| JobResultOption | | || | +| Option | | || | +| Result | | || | +| ResultOption | | || | +| Task | | || | +| TaskOption | | || | +| TaskResult | | || | +| TaskResultOption | | || | +| Validation | | || |