Skip to content

T_CSharpx_Either

Moh.Hassan edited this page Oct 10, 2019 · 1 revision

Either Class

Inheritance Hierarchy

System.Object
  CSharpx.Either
Namespace: CSharpx
Assembly: CommandLine (in CommandLine.dll) Version: 0.0.0

Syntax

C#

internal static class Either

VB

<ExtensionAttribute>
Friend NotInheritable Class Either

C++

[ExtensionAttribute]
internal ref class Either abstract sealed

F#

[<AbstractClassAttribute>]
[<SealedAttribute>]
[<ExtensionAttribute>]
type Either =  class end

The Either type exposes the following members.

Methods

 

Name Description
Public methodStatic member Bimap(TLeft, TRight, TLeft1, TRight1) Maps both parts of a Either type. Applies the first function if Either is Left. Otherwise applies the second function.
Public methodStatic member Bind(TLeft, TRight, TResult) Monadic bind.
Public methodStatic member Cast(TRight) Attempts to cast an object. Stores the cast value in 1Of2 if successful, otherwise stores the exception in 2Of2
Public methodStatic member Fail(TRight) Fail with a message. Not part of mathematical definition of a monad.
Private methodStatic member GetLeft(TLeft, TRight)
Public methodStatic member GetLeftOrDefault(TLeft, TRight) Returns a Either Left or a defualt value.
Public methodStatic member GetOrFail(TLeft, TRight) Returns a Either Right or fail with an exception.
Public methodStatic member GetRightOrDefault(TLeft, TRight) Returns a Either Right or a defualt value.
Public methodStatic member Left(TLeft, TRight)
Public methodStatic member Map(TLeft, TRight, TResult) Transforms a Either's right value by using a specified mapping function.
Public methodStatic member OfMaybe(TLeft, TRight)
Public methodStatic member Return(TRight) Inject a value into the Either type, returning Right case.
Public methodStatic member Right(TLeft, TRight)
Public methodStatic member Select(TLeft, TRight, TResult) Map operation compatible with Linq.
Public methodStatic member SelectMany(TLeft, TRight, TResult)
Public methodStatic member Try(TRight) Wraps a function, encapsulates any exception thrown within to a Either.
  Back to Top

See Also

Reference

CSharpx Namespace

Clone this wiki locally