FsToolkit.ErrorHandling
  • README
  • FsToolkit.ErrorHandling
    • Result
      • apply
      • bind
      • check
      • Computation Expression
      • either Functions
      • fold
      • ignore
      • map
      • map2
      • map3
      • mapError
      • Operators
      • orElse Functions
      • Other Functions
      • require Functions
      • tee Functions
      • tryCreate
      • zip
      • zipError
      • Lists
        • traverseResultM
        • sequenceResultM
        • traverseResultA
        • sequenceResultA
      • Sequences
        • traverseResultM
        • sequenceResultM
        • traverseResultA
        • sequenceResultA
      • Transforms
        • ofChoice
    • Option
      • bind
      • bindNull
      • Computation Expression
      • either
      • map
      • map2
      • map3
      • sequenceAsync
      • sequenceResult
      • sequenceTask
      • sequenceTaskResult
      • tee Functions
      • traverseAsync
      • traverseResult
      • traverseTask
      • traverseTaskResult
      • zip
      • Lists
        • traverseOptionM
        • sequenceOptionM
        • traverseVOptionM
        • sequenceVOptionM
      • Sequences
        • traverseOptionM
        • sequenceOptionM
        • traverseVOptionM
        • sequenceVOptionM
      • Transforms
        • ofNull
        • ofPair
        • ofResult
        • ofValueOption
        • toValueOption
    • ResultOption
      • apply
      • bind
      • Computation Expression
      • ignore
      • map
      • map2
      • map3
      • mapError
      • Operators
      • zip
      • zipError
      • Transforms
        • ofChoice
        • ofOption
        • ofResult
    • AsyncResult
      • apply
      • bind
      • check
      • Computation Expression
      • error
      • foldResult
      • ignore
      • map
      • map2
      • map3
      • mapError
      • Operators
      • Other Functions
      • zip
      • zipError
      • List
        • traverseAsyncResultM
        • sequenceAsyncResultM
        • traverseAsyncResultA
        • sequenceAsyncResultA
      • Sequences
        • traverseAsyncResultM
        • sequenceAsyncResultM
        • traverseAsyncResultA
        • sequenceAsyncResultA
      • Transforms
        • ofAsync
        • ofResult
        • ofTask
        • ofTaskAction
    • AsyncOption
      • apply
      • bind
      • Computation Expression
      • either
      • map
      • orElse Functions
      • Other Functions
    • AsyncResultOption
      • apply
      • bind
      • Computation Expression
      • ignore
      • map
      • map2
      • map3
      • Operators
      • Transforms
        • ofAsyncOption
        • ofAsyncResult
        • ofOption
        • ofResult
    • Task
      • apply
      • bind
      • bindV
      • catch
      • Computation Expression
      • ignore
      • map
      • mapV
      • map2
      • map3
      • zip
      • Transforms
        • ofUnit
    • TaskOption
      • apply
      • bind
      • Computation Expression
      • either
      • map
      • Other Functions
      • zip
    • TaskResult
      • apply
      • bind
      • check
      • catch
      • Computation Expression
      • ignore
      • map
      • map2
      • map3
      • mapError
      • Operators
      • Other Functions
      • error
      • zip
      • zipError
      • Lists
        • traverseTaskResultM
        • sequenceTaskResultM
        • traverseTaskResultA
        • sequenceTaskResultA
      • Transforms
        • ofAsync
        • ofResult
        • ofTask
    • TaskResultOption
      • apply
      • bind
      • Computation Expression
      • ignore
      • map
      • map2
      • map3
      • Operators
    • Validation
      • apply
      • Computation Expression
      • error
      • map
      • map2
      • map3
      • mapError
      • mapErrors
      • Operators
      • zip
      • Transforms
        • ofChoice
        • ofResult
    • AsyncValidation
      • apply
      • Computation Expression
      • error
      • map
      • map2
      • map3
      • mapError
      • mapErrors
      • Operators
      • zip
      • Transforms
        • ofChoice
        • ofResult
    • TaskValidation
      • apply
      • Computation Expression
      • error
      • map
      • map2
      • map3
      • mapError
      • mapErrors
      • Operators
      • zip
      • Transforms
        • ofChoice
        • ofResult
  • FsToolkit.ErrorHandling.AsyncSeq
    • AsyncSeq
      • Computation Expression
  • FsToolkit.ErrorHandling.IcedTasks
    • CancellableTaskResult
      • apply
      • bind
      • Computation Expression
      • getCancellationToken
      • map
      • Operators
      • Other Functions
      • zip
      • parallelZip
    • CancellableTaskValidation
      • apply
      • bind
      • Computation Expression
      • error
      • getCancellationToken
      • map
      • map2
      • map3
      • mapError
      • mapErrors
      • Operators
      • zip
      • parallelZip
      • Transforms
        • ofChoice
        • ofResult
  • FsToolkit.ErrorHandling.JobResult
    • Job
      • apply
      • map2
      • map3
      • singleton
      • zip
    • JobOption
      • apply
      • bind
      • ce
      • either
      • map
    • JobResult
      • apply
      • bind
      • catch
      • Computation Expression
      • error
      • fromTask
      • fromUnitTask
      • ignore
      • map
      • map2
      • map3
      • mapError
      • Operators
      • Other Functions
      • zip
      • zipError
      • Lists
        • traverseJobResultM
        • sequenceJobResultM
        • traverseJobResultA
        • sequenceJobResultA
      • Transforms
        • ofAsync
        • ofJob
        • ofResult
        • fromTask
        • fromUnitTask
    • JobResultOption
      • apply
      • bind
      • Computation Expression
      • ignore
      • map
      • map2
      • map3
  • General Docs
    • Bind Mappings
Powered by GitBook
On this page
  • requireTrue
  • requireFalse
  • requireSome
  • requireNone
  • requireEqual
  • requireEqualTo
  • requireEmpty
  • requireNotEmpty
  • requireHead
  • setError
  • withError
  • defaultValue
  • defaultWith
  • ignoreError
  • tee
  • teeError
  • teeIf
  • teeErrorIf
  • sequenceTask
  1. FsToolkit.ErrorHandling.IcedTasks
  2. CancellableTaskResult

Other Functions

requireTrue

Returns the specified error if the task-wrapped value is false.

'a -> CancellableTask<bool> -> CancellableTask<Result<unit, 'a>>`

requireFalse

Returns the specified error if the task-wrapped value is true.

'a -> CancellableTask<bool> -> CancellableTask<Result<unit, 'a>>`

requireSome

Converts an task-wrapped Option to a Result, using the given error if None.

'a -> CancellableTask<'b option> -> CancellableTask<Result<'b, 'a>>`

requireNone

Converts an task-wrapped Option to a Result, using the given error if Some.

'a -> CancellableTask<'b option> -> CancellableTask<Result<unit, 'a>>`

requireEqual

Returns Ok if the task-wrapped value and the provided value are equal, or the specified error if not. Same as requireEqualTo, but with a parameter order that fits normal function application better than piping.

'a -> CancellableTask<'a> -> 'b -> CancellableTask<Result<unit, 'b>>

requireEqualTo

Returns Ok if the task-wrapped value and the provided value are equal, or the specified error if not. Same as requireEqual, but with a parameter order that fits piping better than normal function application.

'a -> 'b -> CancellableTask<'a> -> CancellableTask<Result<unit, 'b>>

requireEmpty

Returns Ok if the task-wrapped sequence is empty, or the specified error if not.

'a -> CancellableTask<'b> -> CancellableTask<Result<unit, 'a>>

requireNotEmpty

Returns Ok if the task-wrapped sequence is non-empty, or the specified error if not.

'a -> CancellableTask<'b> -> CancellableTask<Result<unit, 'a>>

requireHead

Returns the first item of the sequence if it exists, or the specified error if the sequence is empty

'a -> CancellableTask<'b> -> CancellableTask<Result<'c, 'a>>

setError

Replaces an error value of an task-wrapped result with a custom error value

'a -> CancellableTask<Result<'b, 'c>> -> CancellableTask<Result<'b, 'a>>

withError

Replaces a unit error value of an task-wrapped result with a custom error value. Safer than setError since you're not losing any information.

'a -> CancellableTask<Result<'b, unit>> -> CancellableTask<Result<'b, 'a>>

defaultValue

Extracts the contained value of an task-wrapped result if Ok, otherwise uses the provided value.

'a -> CancellableTask<Result<'a, 'b>> -> CancellableTask<'a>

defaultWith

Extracts the contained value of an task-wrapped result if Ok, otherwise evaluates the given function and uses the result.

(unit -> 'a) -> CancellableTask<Result<'a, 'b>> -> CancellableTask<'a>

ignoreError

Same as defaultValue for a result where the Ok value is unit. The name describes better what is actually happening in this case.

CancellableTask<Result<unit, 'a>> -> CancellableTask<unit>

tee

If the task-wrapped result is Ok, executes the function on the Ok value. Passes through the input value unchanged.

('a -> unit) -> CancellableTask<Result<'a, 'b>> -> CancellableTask<Result<'a, 'b>>

teeError

If the task-wrapped result is Error, executes the function on the Error value. Passes through the input value unchanged.

('a -> unit) -> CancellableTask<Result<'b, 'a>> -> CancellableTask<Result<'b, 'a>>

teeIf

If the task-wrapped result is Ok and the predicate returns true for the wrapped value, executes the function on the Ok value. Passes through the input value unchanged.

('a -> bool) -> ('a -> unit) -> CancellableTask<Result<'a, 'b>> -> CancellableTask<Result<'a, 'b>>

teeErrorIf

If the task-wrapped result is Error and the predicate returns true for the wrapped value, executes the function on the Error value. Passes through the input value unchanged.

('a -> bool) -> ('a -> unit) -> CancellableTask<Result<'b, 'a>> -> CancellableTask<Result<'b, 'a>>

sequenceTask

Converts a Result<CancellableTask<'a>, 'b> to CancellableTask<Result<'a, 'b>>.

Result<CancellableTask<'a>, 'b> -> CancellableTask<Result<'a, 'b>>
PreviousOperatorsNextCancellableTaskValidation

Last updated 1 year ago