either

Undocumented in source.

Members

Aliases

TestEither
alias TestEither = Either!(int, Exception)
Undocumented in source.

Enums

EitherSide
enum EitherSide

Functions

alwaysFalse
bool alwaysFalse(bool )
Undocumented in source. Be warned that the author may not have intended to support it.
alwaysFalseInt
bool alwaysFalseInt(int )
Undocumented in source. Be warned that the author may not have intended to support it.
alwaysTrue
bool alwaysTrue(bool )
Undocumented in source. Be warned that the author may not have intended to support it.
alwaysTrueInt
bool alwaysTrueInt(int )
Undocumented in source. Be warned that the author may not have intended to support it.
bind
Either!(Any, T) bind(T value)
Either!(Left, Right) bind(T value)
auto bind(T value)
void bind()
Either!(PickDefinedType!(L, Left), PickDefinedType!(R, Right)) bind(This value)

Wraps a value as an Either monad

bindLeft
auto bindLeft(T value)
callIfCan
auto callIfCan(This either, MapFunction mapFunction)
callWith
auto callWith(This either, MapFunction mapFunction)
canCheck
bool canCheck()
checkEither
auto checkEither(This either)
isCallableWith
bool isCallableWith()
isLeft
bool isLeft(T either)

returns true when the Left type is stored

isRight
bool isRight(T either)

returns true when the Right type is stored

returnsAnyOf
bool returnsAnyOf()

Check if the matcher returns any of the provided return types

when
auto when(This either, T newValue)

Match Left or Right values by value examples

when
This when(This either, Matcher matcher)

Match Left or Right values using types

when
Either!(NewLeft!(This, T), NewRight!(This, T)) when(This either, T result)

Match Left or Right values using a check function

Structs

Any
struct Any
Either
struct Either(Left, Right)

The Either type represents values with two possibilities: a value of type Either a b is either Left a or Right b.

Templates

EitherTypeOf
template EitherTypeOf(T, Left, Right)
NewLeft
template NewLeft(This : Either!(Left, Right), That, Left, Right)
NewRight
template NewRight(This : Either!(Left, Right), That, Left, Right)
PickDefinedType
template PickDefinedType(A, B)
Undocumented in source.
hasVoidReturn
template hasVoidReturn(Func)

Returns true if the function returns void

isEitherStruct
template isEitherStruct(T)

Returns true if the given struct can be use as an Either struct

Meta