Skip to content

CatchAsync over a ValueTask, and TraverseAsync on Option and Patch #88

Closed

Description

@CaffeinatedCoder

The roadmap's 2.3.0 section lists CatchAsync over a ValueTask, and TraverseAsync on Option and Patch.

  • Result.CatchAsync takes a Func<Task<T>>/Func<Task>; a ValueTask goes through .AsTask() or an async lambda (Core README, "A ValueTask … is rejected when called").
  • Option<T>.Traverse and Patch<T>.Traverse exist (ResultExtensions.cs), and TraverseAsync exists on a sequence, but not on an Option or a Patch.

Proposal

  • CatchAsync overloads over Func<ValueTask<T>> and Func<ValueTask>, with the narrowed <T, TException> forms, catching as the Task forms do (an exception after the first await, cancellation as the Task forms treat it).
  • Option<T>.TraverseAsync and Patch<T>.TraverseAsync over Func<T, Task<Result<TResult, TError>>>, with the CancellationToken forms, as the synchronous Traverse and the sequence's TraverseAsync behave: None/Absent/Null never call the selector.

Done when

  • Each new member has the behaviour tests its Task or synchronous sibling has, and the surface tables in docs/ list them (checked by reflection).
  • Overload resolution: an async lambda given to CatchAsync still binds as before (a test pins the existing calls).
  • Core README documents them; changelog entry.

Activity

  1. added this to the 2.3.0 milestone on Oct 28, 2026
  2. added
    enhancement
    package/core
    area/option-result
    on Oct 28, 2026
  3. CaffeinatedCoder commented on Oct 28, 2026

    @CaffeinatedCoder
    OwnerAuthor

    Done in PR #94, merged into release/2.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/option-resultenhancementpackage/core

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions