Table of Contents

Class BindZipExtensions

Namespace
Trellis
Assembly
Trellis.Results.dll

Extension methods that bind a function to a Result and zip the original value with the new value into a tuple. Enables sequential accumulation of values through a pipeline.

public static class BindZipExtensions
Inheritance
BindZipExtensions
Inherited Members

Methods

BindZip<T1, T2>(Result<T1>, Func<T1, Result<T2>>)

Binds a function to the Result value and zips both values into a tuple on success. If the source or the function result is a failure, returns that failure.

public static Result<(T1, T2)> BindZip<T1, T2>(this Result<T1> result, Func<T1, Result<T2>> func)

Parameters

result Result<T1>

The result to bind and zip.

func Func<T1, Result<T2>>

The function to call if the result is successful.

Returns

Result<(T1, T2)>

A tuple result combining both values on success; otherwise the failure.

Type Parameters

T1

Type of the input result value.

T2

Type of the new result value.