|
| 1 | +namespace FsToolkit.ErrorHandling.Operator.TaskValidation |
| 2 | + |
| 3 | +open FsToolkit.ErrorHandling |
| 4 | + |
| 5 | +[<AutoOpen>] |
| 6 | +module TaskValidation = |
| 7 | + let inline (<!>) |
| 8 | + ([<InlineIfLambda>] mapper: 'okInput -> 'okOutput) |
| 9 | + (input: TaskValidation<'okInput, 'error>) |
| 10 | + : TaskValidation<'okOutput, 'error> = |
| 11 | + TaskValidation.map mapper input |
| 12 | + |
| 13 | + let inline (<!^>) |
| 14 | + ([<InlineIfLambda>] mapper: 'okInput -> 'okOutput) |
| 15 | + (input: Result<'okInput, 'error>) |
| 16 | + : TaskValidation<'okOutput, 'error> = |
| 17 | + TaskValidation.map mapper (TaskValidation.ofResult input) |
| 18 | + |
| 19 | + let inline (<*>) |
| 20 | + (applier: TaskValidation<('okInput -> 'okOutput), 'error>) |
| 21 | + (input: TaskValidation<'okInput, 'error>) |
| 22 | + : TaskValidation<'okOutput, 'error> = |
| 23 | + TaskValidation.apply applier input |
| 24 | + |
| 25 | + let inline (<*^>) |
| 26 | + (applier: TaskValidation<('okInput -> 'okOutput), 'error>) |
| 27 | + (input: Result<'okInput, 'error>) |
| 28 | + : TaskValidation<'okOutput, 'error> = |
| 29 | + TaskValidation.apply applier (TaskValidation.ofResult input) |
| 30 | + |
| 31 | + let inline (>>=) |
| 32 | + (input: TaskValidation<'okInput, 'error>) |
| 33 | + ([<InlineIfLambda>] binder: 'okInput -> TaskValidation<'okOutput, 'error>) |
| 34 | + : TaskValidation<'okOutput, 'error> = |
| 35 | + TaskValidation.bind binder input |
0 commit comments