T_RailwaySharp_ErrorHandling_ResultExtensions - adutton/commandline GitHub Wiki
Extensions methods for easier usage.
System.Object
RailwaySharp.ErrorHandling.ResultExtensions
Namespace: RailwaySharp.ErrorHandling
Assembly: CommandLine (in CommandLine.dll) Version: 0.0.0
C#
internal static class ResultExtensionsVB
<ExtensionAttribute>
Friend NotInheritable Class ResultExtensionsC++
[ExtensionAttribute]
internal ref class ResultExtensions abstract sealedF#
[<AbstractClassAttribute>]
[<SealedAttribute>]
[<ExtensionAttribute>]
type ResultExtensions = class endThe ResultExtensions type exposes the following members.
| Name | Description | |
|---|---|---|
![]()
|
Collect(TSuccess, TMessage) | Collects a sequence of Results and accumulates their values. If the sequence contains an error the error will be propagated. |
![]()
|
Either(TSuccess, TMessage, TResult) | Allows pattern matching on Results. |
![]()
|
FailedWith(TSuccess, TMessage) | Returns the error messages or fails if the result was a success. |
![]()
|
Flatten(TSuccess, TMessage) | Collects a sequence of Results and accumulates their values. If the sequence contains an error the error will be propagated. |
![]()
|
Map(TSuccess, TMessage, TResult) | Lifts a Func into a Result and applies it on the given result. |
![]()
|
Match(TSuccess, TMessage) | Allows pattern matching on Results. |
![]()
|
Select(TSuccess, TMessage, TResult) | Lifts a Func into a Result and applies it on the given result. |
![]()
|
SelectMany(TSuccess, TMessage, TResult)(Result(TSuccess, TMessage), Func(TSuccess, Result(TResult, TMessage))) | If the result is a Success it executes the given Func on the value. Otherwise the exisiting failure is propagated. |
![]()
|
SelectMany(TSuccess, TMessage, TValue, TResult)(Result(TSuccess, TMessage), Func(TSuccess, Result(TValue, TMessage)), Func(TSuccess, TValue, TResult)) | If the result is a Success it executes the given Func on the value. If the result of the Func is a Success it maps it using the given Func. Otherwise the exisiting failure is propagated. |
![]()
|
SucceededWith(TSuccess, TMessage) | Returns the result or fails if the result was an error. |
