Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
Smooth.Algebraics.Either< L, R > Struct Template Reference

Struct representing a value that can be an instance of either the L (left) or the R (right) type. More...

Inheritance diagram for Smooth.Algebraics.Either< L, R >:

Public Member Functions

Cata< V > (DelegateFunc< L, V > leftFunc, DelegateFunc< R, V > rightFunc)
 If the either isLeft, returns leftFunc applied to the either's value; otherwise, returns rightFunc applied to the either's value. More...
 
Cata< V, P > (DelegateFunc< L, P, V > leftFunc, P p, DelegateFunc< R, V > rightFunc)
 If the either isLeft, returns leftFunc applied to the either's value and p; otherwise, returns rightFunc applied to the either's value. More...
 
Cata< V, P, P2 > (DelegateFunc< L, P, V > leftFunc, P p, DelegateFunc< R, P2, V > rightFunc, P2 p2)
 If the either isLeft, returns leftFunc applied to the either's value and p; otherwise, returns rightFunc applied to the either's value and p2. More...
 
Cata< V, P2 > (DelegateFunc< L, V > leftFunc, DelegateFunc< R, P2, V > rightFunc, P2 p2)
 If the either isLeft, returns leftFunc applied to the either's value; otherwise, returns rightFunc applied to the either's value and p2. More...
 
int CompareTo (Either< L, R > other)
 
override bool Equals (object o)
 
bool Equals (Either< L, R > other)
 
void ForEach (DelegateAction< L > leftAction, DelegateAction< R > rightAction)
 If the either isLeft, applies leftAction to the either's value; otherwise, applies rightAction to the either's value. More...
 
void ForEach< P > (DelegateAction< L, P > leftAction, P p, DelegateAction< R > rightAction)
 If the either isLeft, applies leftAction to the either's value and p; otherwise, applies rightAction to the either's value. More...
 
void ForEach< P, P2 > (DelegateAction< L, P > leftAction, P p, DelegateAction< R, P2 > rightAction, P2 p2)
 If the either isLeft, applies leftAction to the either's value and p; otherwise, applies rightAction to the either's value and p2. More...
 
void ForEach< P2 > (DelegateAction< L > leftAction, DelegateAction< R, P2 > rightAction, P2 p2)
 If the either isLeft, applies leftAction to the either's value; otherwise, applies rightAction to the either's value and p2. More...
 
override int GetHashCode ()
 
override string ToString ()
 

Static Public Member Functions

static Either< L, RLeft (L value)
 Returns a left either containing the specified value. More...
 
static bool operator!= (Either< L, R > lhs, Either< L, R > rhs)
 
static bool operator< (Either< L, R > lhs, Either< L, R > rhs)
 
static bool operator<= (Either< L, R > lhs, Either< L, R > rhs)
 
static bool operator== (Either< L, R > lhs, Either< L, R > rhs)
 
static bool operator> (Either< L, R > lhs, Either< L, R > rhs)
 
static bool operator>= (Either< L, R > lhs, Either< L, R > rhs)
 
static Either< L, RRight (R value)
 Returns a right either containing the specified value. More...
 

Public Attributes

readonly bool isLeft
 True if the either contains an L value; otherwise, false; More...
 
readonly L leftValue
 If the either isLeft, the value contained by the either; otherwise, default(L). More...
 
readonly R rightValue
 If the either isRight, the value contained by the either; otherwise, default(R). More...
 

Properties

bool isRight [get]
 True if the either contains an R value; otherwise, false; More...
 
Option< L > leftOption [get]
 If the either isLeft, the an option containing the either's value; otherwise, an empty option. More...
 
Option< RrightOption [get]
 If the either isRight, the an option containing the either's value; otherwise, an empty option. More...
 

Detailed Description

Struct representing a value that can be an instance of either the L (left) or the R (right) type.

Member Function Documentation

V Smooth.Algebraics.Either< L, R >.Cata< V > ( DelegateFunc< L, V >  leftFunc,
DelegateFunc< R, V >  rightFunc 
)
inline

If the either isLeft, returns leftFunc applied to the either's value; otherwise, returns rightFunc applied to the either's value.

V Smooth.Algebraics.Either< L, R >.Cata< V, P > ( DelegateFunc< L, P, V >  leftFunc,
p,
DelegateFunc< R, V >  rightFunc 
)
inline

If the either isLeft, returns leftFunc applied to the either's value and p; otherwise, returns rightFunc applied to the either's value.

V Smooth.Algebraics.Either< L, R >.Cata< V, P, P2 > ( DelegateFunc< L, P, V >  leftFunc,
p,
DelegateFunc< R, P2, V >  rightFunc,
P2  p2 
)
inline

If the either isLeft, returns leftFunc applied to the either's value and p; otherwise, returns rightFunc applied to the either's value and p2.

V Smooth.Algebraics.Either< L, R >.Cata< V, P2 > ( DelegateFunc< L, V >  leftFunc,
DelegateFunc< R, P2, V >  rightFunc,
P2  p2 
)
inline

If the either isLeft, returns leftFunc applied to the either's value; otherwise, returns rightFunc applied to the either's value and p2.

int Smooth.Algebraics.Either< L, R >.CompareTo ( Either< L, R other)
inline
override bool Smooth.Algebraics.Either< L, R >.Equals ( object  o)
inline
bool Smooth.Algebraics.Either< L, R >.Equals ( Either< L, R other)
inline
void Smooth.Algebraics.Either< L, R >.ForEach ( DelegateAction< L >  leftAction,
DelegateAction< R rightAction 
)
inline

If the either isLeft, applies leftAction to the either's value; otherwise, applies rightAction to the either's value.

void Smooth.Algebraics.Either< L, R >.ForEach< P > ( DelegateAction< L, P >  leftAction,
p,
DelegateAction< R rightAction 
)
inline

If the either isLeft, applies leftAction to the either's value and p; otherwise, applies rightAction to the either's value.

void Smooth.Algebraics.Either< L, R >.ForEach< P, P2 > ( DelegateAction< L, P >  leftAction,
p,
DelegateAction< R, P2 >  rightAction,
P2  p2 
)
inline

If the either isLeft, applies leftAction to the either's value and p; otherwise, applies rightAction to the either's value and p2.

void Smooth.Algebraics.Either< L, R >.ForEach< P2 > ( DelegateAction< L >  leftAction,
DelegateAction< R, P2 >  rightAction,
P2  p2 
)
inline

If the either isLeft, applies leftAction to the either's value; otherwise, applies rightAction to the either's value and p2.

override int Smooth.Algebraics.Either< L, R >.GetHashCode ( )
inline
static Either<L, R> Smooth.Algebraics.Either< L, R >.Left ( value)
inlinestatic

Returns a left either containing the specified value.

Parameters
valueValue.
static bool Smooth.Algebraics.Either< L, R >.operator!= ( Either< L, R lhs,
Either< L, R rhs 
)
inlinestatic
static bool Smooth.Algebraics.Either< L, R >.operator< ( Either< L, R lhs,
Either< L, R rhs 
)
inlinestatic
static bool Smooth.Algebraics.Either< L, R >.operator<= ( Either< L, R lhs,
Either< L, R rhs 
)
inlinestatic
static bool Smooth.Algebraics.Either< L, R >.operator== ( Either< L, R lhs,
Either< L, R rhs 
)
inlinestatic
static bool Smooth.Algebraics.Either< L, R >.operator> ( Either< L, R lhs,
Either< L, R rhs 
)
inlinestatic
static bool Smooth.Algebraics.Either< L, R >.operator>= ( Either< L, R lhs,
Either< L, R rhs 
)
inlinestatic
static Either<L, R> Smooth.Algebraics.Either< L, R >.Right ( R  value)
inlinestatic

Returns a right either containing the specified value.

Parameters
valueValue.
override string Smooth.Algebraics.Either< L, R >.ToString ( )
inline

Member Data Documentation

readonly bool Smooth.Algebraics.Either< L, R >.isLeft

True if the either contains an L value; otherwise, false;

readonly L Smooth.Algebraics.Either< L, R >.leftValue

If the either isLeft, the value contained by the either; otherwise, default(L).

readonly R Smooth.Algebraics.Either< L, R >.rightValue

If the either isRight, the value contained by the either; otherwise, default(R).

Property Documentation

bool Smooth.Algebraics.Either< L, R >.isRight
get

True if the either contains an R value; otherwise, false;

Option<L> Smooth.Algebraics.Either< L, R >.leftOption
get

If the either isLeft, the an option containing the either's value; otherwise, an empty option.

Option<R> Smooth.Algebraics.Either< L, R >.rightOption
get

If the either isRight, the an option containing the either's value; otherwise, an empty option.


The documentation for this struct was generated from the following file: