Namespace: FsToolkit.ErrorHandling
Lifts a value into a CancellableTaskValidation, wrapping it as an Ok result. This is the primary way to create a successful CancellableTaskValidation value.
'item -> CancellableTaskValidation<'item, 'Error>let result : CancellableTaskValidation<int, string> =
CancellableTaskValidation.singleton 42Using singleton inside a pipeline to return a validated value:
let validateAge (age: int) : CancellableTaskValidation<int, string> =
if age >= 0 then CancellableTaskValidation.singleton age
else CancellableTaskValidation.error "Age must be non-negative"