- EitherAsync <L, R>
- Bottom = new EitherAsync<L, R>()
- State
- IsRight
- IsLeft
- IsBottom
- Case
- GetAwaiter ()
- Equals (object _)
- Equals <EqL, EqR> (EitherAsync<L, R> rhs)
- Equals (EitherAsync<L, R> rhs)
- == (EitherAsync<L, R> lhs, EitherAsync<L, R> rhs)
- != (EitherAsync<L, R> lhs, EitherAsync<L, R> rhs)
- CompareTo <OrdL, OrdR> (EitherAsync<L, R> rhs)
- CompareTo (EitherAsync<L, R> rhs)
- < (EitherAsync<L, R> lhs, EitherAsync<L, R> rhs)
- <= (EitherAsync<L, R> lhs, EitherAsync<L, R> rhs)
- > (EitherAsync<L, R> lhs, EitherAsync<L, R> rhs)
- >= (EitherAsync<L, R> lhs, EitherAsync<L, R> rhs)
- Match <Ret> (Func<R, Ret> Right, Func<L, Ret> Left, Func<Ret> Bottom = null)
- MatchAsync <Ret> (Func<R, Ret> Right, Func<L, Task<Ret>> LeftAsync, Func<Ret> Bottom = null)
- MatchAsync <Ret> (Func<R, Task<Ret>> RightAsync, Func<L, Ret> Left, Func<Ret> Bottom = null)
- MatchAsync <Ret> (Func<R, Task<Ret>> RightAsync, Func<L, Task<Ret>> LeftAsync, Func<Ret> Bottom = null)
- MatchUnsafe <Ret> (Func<R, Ret> Right, Func<L, Ret> Left, Func<Ret> Bottom = null)
- MatchUnsafeAsync <Ret> (Func<R, Task<Ret>> RightAsync, Func<L, Ret> Left, Func<Ret> Bottom = null)
- MatchUnsafeAsync <Ret> (Func<R, Task<Ret>> RightAsync, Func<L, Task<Ret>> LeftAsync, Func<Ret> Bottom = null)
- MatchUnsafeAsync <Ret> (Func<R, Ret> Right, Func<L, Task<Ret>> LeftAsync, Func<Ret> Bottom = null)
- Match (Action<R> Right, Action<L> Left, Action Bottom = null)
- MatchAsync (Action<R> Right, Func<L, Task> LeftAsync, Action Bottom = null)
- MatchAsync (Func<R, Task> RightAsync, Action<L> Left, Action Bottom = null)
- MatchAsync (Func<R, Task> RightAsync, Func<L, Task> LeftAsync, Action Bottom = null)
- IfLeft (Func<R> Left)
- IfLeftAsync (Func<Task<R>> LeftAsync)
- IfLeft (Func<L, R> Left)
- IfLeftAsync (Func<L, Task<R>> LeftAsync)
- IfLeft (R Right)
- IfLeftAsync (Task<R> RightAsync)
- IfLeft (Action<L> Left)
- IfLeftAsync (Func<L, Task> LeftAsync)
- IfRight (Action<R> Right)
- IfRightAsync (Func<R, Task> RightAsync)
- IfRight (L Left)
- IfRight (Func<L> Right)
- IfRightAsync (Func<Task<L>> RightAsync)
- IfRight (Func<R, L> Right)
- IfRightAsync (Func<R, Task<L>> RightAsync)
- Right (Action<R> right)
- Right <Ret> (Func<R, Ret> right)
- ToString ()
- ToStringAsync ()
- GetHashCode ()
- GetHashCodeAsync ()
- RightToList ()
- RightToArray ()
- LeftToList ()
- LeftToArray ()
- ToSeq ()
- RightToSeq ()
- LeftToSeq ()
- RightAsEnumerable ()
- LeftAsEnumerable ()
- ToValidation ()
- ToOption ()
- ToAff (Func<L, Common.Error> Left)
- ToEitherUnsafe ()
- ToEither ()
- ToTryOption ()
- | (EitherAsync<L, R> lhs, EitherAsync<L, R> rhs)
- GetUnderlyingRightType ()
- GetUnderlyingLeftType ()
- Right (R value)
- RightAsync (Task<R> value)
- Left (L value)
- LeftAsync (Task<L> value)
- GetUnderlyingType ()
- Count ()
- Swap ()
- Iter (Action<R> Right)
- BiIter (Action<R> Right, Action<L> Left)
- ForAll (Func<R, bool> Right)
- ForAllAsync (Func<R, Task<bool>> Right)
- BiForAll (Func<R, bool> Right, Func<L, bool> Left)
- BiForAllAsync (Func<R, Task<bool>> RightAsync, Func<L, bool> Left)
- BiForAllAsync (Func<R, bool> Right, Func<L, Task<bool>> LeftAsync)
- BiForAllAsync (Func<R, Task<bool>> RightAsync, Func<L, Task<bool>> LeftAsync)
- Fold <S> (S state, Func<S, R, S> Right)
- FoldAsync <S> (S state, Func<S, R, Task<S>> RightAsync)
- BiFold <S> (S state, Func<S, R, S> Right, Func<S, L, S> Left)
- BiFoldAsync <S> (S state, Func<S, R, Task<S>> RightAsync, Func<S, L, S> Left)
- BiFoldAsync <S> (S state, Func<S, R, Task<S>> RightAsync, Func<S, L, Task<S>> LeftAsync)
- BiFoldAsync <S> (S state, Func<S, R, S> Right, Func<S, L, Task<S>> LeftAsync)
- Exists (Func<R, bool> pred)
- ExistsAsync (Func<R, Task<bool>> pred)
- BiExists (Func<R, bool> Right, Func<L, bool> Left)
- BiExistsAsync (Func<R, Task<bool>> RightAsync, Func<L, bool> Left)
- BiExistsAsync (Func<R, Task<bool>> RightAsync, Func<L, Task<bool>> LeftAsync)
- BiExistsAsync (Func<R, bool> Right, Func<L, Task<bool>> LeftAsync)
- Do (Action<R> f)
- Map <Ret> (Func<R, Ret> f)
- MapAsync <Ret> (Func<R, Task<Ret>> f)
- MapLeft <Ret> (Func<L, Ret> f)
- MapLeftAsync <Ret> (Func<L, Task<Ret>> f)
- BiMapAsync <Ret> (Func<R, Task<Ret>> RightAsync, Func<L, Ret> Left)
- BiMapAsync <Ret> (Func<R, Ret> Right, Func<L, Task<Ret>> LeftAsync)
- BiMap <L2, R2> (Func<R, R2> Right, Func<L, L2> Left)
- BiMapAsync <L2, R2> (Func<R, Task<R2>> RightAsync, Func<L, L2> Left)
- BiMapAsync <L2, R2> (Func<R, R2> Right, Func<L, Task<L2>> LeftAsync)
- BiMapAsync <L2, R2> (Func<R, Task<R2>> RightAsync, Func<L, Task<L2>> LeftAsync)
- Bind <Ret> (Func<R, EitherAsync<L, Ret>> f)
- BindAsync <Ret> (Func<R, Task<EitherAsync<L, Ret>>> f)
- BiBind <B> (Func<R, EitherAsync<L, B>> Right, Func<L, EitherAsync<L, B>> Left)
- BiBindAsync <B> (Func<R, Task<EitherAsync<L, B>>> RightAsync, Func<L, EitherAsync<L, B>> Left)
- BiBindAsync <B> (Func<R, EitherAsync<L, B>> Right, Func<L, Task<EitherAsync<L, B>>> LeftAsync)
- BiBindAsync <B> (Func<R, Task<EitherAsync<L, B>>> RightAsync, Func<L, Task<EitherAsync<L, B>>> LeftAsync)
- BindLeft <B> (Func<L, EitherAsync<B, R>> Left)
- BindLeftAsync <B> (Func<L, Task<EitherAsync<B, R>>> LeftAsync)
- Filter (Func<R, bool> pred)
- FilterAsync (Func<R, Task<bool>> pred)
- Where (Func<R, bool> pred)
- Select <U> (Func<R, U> map)
- SelectMany <U, V> (Func<R, EitherAsync<L, U>> bind, Func<R, U, V> project)
- GetAsyncEnumerator (CancellationToken cancellationToken = default)
- EitherAsyncContext <L, R, Ret>
- EitherAsyncUnitContext <L, R>
- EitherAsyncExtensions
- Flatten <L, R> (this EitherAsync<L, EitherAsync<L, R>> ma)
- Flatten <L, R> (this EitherAsync<EitherAsync<L, R>, EitherAsync<L, R>> ma)
- Plus <NUM, L, R> (this EitherAsync<L, R> x, EitherAsync<L, R> y)
- Subtract <NUM, L, R> (this EitherAsync<L, R> x, EitherAsync<L, R> y)
- Product <NUM, L, R> (this EitherAsync<L, R> x, EitherAsync<L, R> y)
- Divide <NUM, L, R> (this EitherAsync<L, R> x, EitherAsync<L, R> y)
- Apply <L, A, B> (this EitherAsync<L, Func<A, B>> fab, EitherAsync<L, A> fa)
- Apply <L, A, B> (this Func<A, B> fab, EitherAsync<L, A> fa)
- Apply <L, A, B, C> (this EitherAsync<L, Func<A, B, C>> fabc, EitherAsync<L, A> fa, EitherAsync<L, B> fb)
- Apply <L, A, B, C> (this Func<A, B, C> fabc, EitherAsync<L, A> fa, EitherAsync<L, B> fb)
- Apply <L, A, B, C> (this EitherAsync<L, Func<A, B, C>> fabc, EitherAsync<L, A> fa)
- Apply <L, A, B, C> (this Func<A, B, C> fabc, EitherAsync<L, A> fa)
- Apply <L, A, B, C> (this EitherAsync<L, Func<A, Func<B, C>>> fabc, EitherAsync<L, A> fa)
- Apply <L, A, B, C> (this Func<A, Func<B, C>> fabc, EitherAsync<L, A> fa)
- Action <L, A, B> (this EitherAsync<L, A> fa, EitherAsync<L, B> fb)
- Lefts <L, R> (this IEnumerable<EitherAsync<L, R>> self)
- Lefts <L, R> (this Seq<EitherAsync<L, R>> self)
- Rights <L, R> (this IEnumerable<EitherAsync<L, R>> self)
- Rights <L, R> (this Seq<EitherAsync<L, R>> self)
- Partition <L, R> (this Seq<EitherAsync<L, R>> self)
- Partition <L, R> (this IEnumerable<EitherAsync<L, R>> self)
- Sum <NUM, L, R> (this EitherAsync<L, R> self)
- Sum <L> (this EitherAsync<L, int> self)
- ParMap <L, T1, T2, R> (this EitherAsync<L, T1> self, Func<T1, T2, R> func)
- ParMap <L, T1, T2, T3, R> (this EitherAsync<L, T1> self, Func<T1, T2, T3, R> func)
- ToAff <R> (EitherAsync<Error, R> ma)
- ToAff <R> (EitherAsync<Exception, R> ma)
- ToAff <R> (EitherAsync<string, R> ma)
- EitherAsyncGuardExtensions
- ToEitherAsync <L> (this Guard<L> ma)
- SelectMany <L, B> (this Guard<L> ma, Func<Unit, EitherAsync<L, B>> f)
- SelectMany <L, B, C> (this Guard<L> ma, Func<Unit, EitherAsync<L, B>> bind, Func<Unit, B, C> project)
- SelectMany <L, A> (this EitherAsync<L, A> ma, Func<A, Guard<L>> f)
- SelectMany <L, A, C> (this EitherAsync<L, A> ma, Func<A, Guard<L>> bind, Func<A, Unit, C> project)
- Prelude
- flatten <L, R> (EitherAsync<L, EitherAsync<L, R>> ma)
- plus <NUM, L, R> (EitherAsync<L, R> x, EitherAsync<L, R> y)
- subtract <NUM, L, R> (EitherAsync<L, R> x, EitherAsync<L, R> y)
- product <NUM, L, R> (EitherAsync<L, R> x, EitherAsync<L, R> y)
- divide <NUM, L, R> (EitherAsync<L, R> x, EitherAsync<L, R> y)
- apply <L, A, B> (EitherAsync<L, Func<A, B>> fab, EitherAsync<L, A> fa)
- apply <L, A, B> (Func<A, B> fab, EitherAsync<L, A> fa)
- apply <L, A, B, C> (EitherAsync<L, Func<A, B, C>> fabc, EitherAsync<L, A> fa, EitherAsync<L, B> fb)
- apply <L, A, B, C> (Func<A, B, C> fabc, EitherAsync<L, A> fa, EitherAsync<L, B> fb)
- apply <L, A, B, C> (EitherAsync<L, Func<A, B, C>> fabc, EitherAsync<L, A> fa)
- apply <L, A, B, C> (Func<A, B, C> fabc, EitherAsync<L, A> fa)
- apply <L, A, B, C> (EitherAsync<L, Func<A, Func<B, C>>> fabc, EitherAsync<L, A> fa)
- apply <L, A, B, C> (Func<A, Func<B, C>> fabc, EitherAsync<L, A> fa)
- action <L, A, B> (EitherAsync<L, A> fa, EitherAsync<L, B> fb)
- isRight <L, R> (EitherAsync<L, R> value)
- isLeft <L, R> (EitherAsync<L, R> value)
- RightAsync <L, R> (Task<R> value)
- RightAsync <L, R> (Func<Unit, Task<R>> value)
- RightAsync <L, R> (R value)
- LeftAsync <L, R> (Task<L> value)
- LeftAsync <L, R> (Func<Unit, Task<L>> value)
- LeftAsync <L, R> (L value)
- ifLeft <L, R> (EitherAsync<L, R> either, Func<R> LeftSync)
- ifLeft <L, R> (EitherAsync<L, R> either, Func<L, R> LeftSync)
- ifLeftAsync <L, R> (EitherAsync<L, R> either, Func<L, Task<R>> LeftAsync)
- ifLeft <L, R> (EitherAsync<L, R> either, R Right)
- ifLeft <L, R> (EitherAsync<L, R> either, Action<L> Left)
- ifLeftAsync <L, R> (EitherAsync<L, R> either, Func<L, Task> Left)
- ifRight <L, R> (EitherAsync<L, R> either, Action<R> Right)
- ifRightAsync <L, R> (EitherAsync<L, R> either, Func<R, Task> RightAsync)
- ifRight <L, R> (EitherAsync<L, R> either, L Left)
- ifRightAsync <L, R> (EitherAsync<L, R> either, Func<Task<L>> RightAsync)
- ifRight <L, R> (EitherAsync<L, R> either, Func<L> Left)
- ifRight <L, R> (EitherAsync<L, R> either, Func<R, L> Left)
- ifRightAsync <L, R> (EitherAsync<L, R> either, Func<R, Task<L>> LeftAsync)
- match <L, R, Ret> (EitherAsync<L, R> either, Func<R, Ret> Right, Func<L, Ret> Left, Func<Ret> Bottom = null)
- matchAsync <L, R, Ret> (EitherAsync<L, R> either, Func<R, Task<Ret>> RightAsync, Func<L, Ret> Left, Func<Ret> Bottom = null)
- matchAsync <L, R, Ret> (EitherAsync<L, R> either, Func<R, Ret> Right, Func<L, Task<Ret>> LeftAsync, Func<Ret> Bottom = null)
- matchAsync <L, R, Ret> (EitherAsync<L, R> either, Func<R, Task<Ret>> RightAsync, Func<L, Task<Ret>> LeftAsync, Func<Ret> Bottom = null)
- match <L, R> (EitherAsync<L, R> either, Action<R> Right, Action<L> Left, Action Bottom = null)
- matchAsync <L, R> (EitherAsync<L, R> either, Func<R, Task> RightAsync, Action<L> Left, Action Bottom = null)
- matchAsync <L, R> (EitherAsync<L, R> either, Action<R> Right, Func<L, Task> LeftAsync, Action Bottom = null)
- matchAsync <L, R> (EitherAsync<L, R> either, Func<R, Task> RightAsync, Func<L, Task> LeftAsync, Action Bottom = null)
- fold <S, L, R> (EitherAsync<L, R> either, S state, Func<S, R, S> Right)
- foldAsync <S, L, R> (EitherAsync<L, R> either, S state, Func<S, R, Task<S>> RightAsync)
- bifold <L, R, S> (EitherAsync<L, R> either, S state, Func<S, R, S> Right, Func<S, L, S> Left)
- bifoldAsync <L, R, S> (EitherAsync<L, R> either, S state, Func<S, R, Task<S>> RightAsync, Func<S, L, S> Left)
- bifoldAsync <L, R, S> (EitherAsync<L, R> either, S state, Func<S, R, S> Right, Func<S, L, Task<S>> LeftAsync)
- bifoldAsync <L, R, S> (EitherAsync<L, R> either, S state, Func<S, R, Task<S>> RightAsync, Func<S, L, Task<S>> LeftAsync)
- forall <L, R> (EitherAsync<L, R> either, Func<R, bool> pred)
- forallAsync <L, R> (EitherAsync<L, R> either, Func<R, Task<bool>> pred)
- biforall <L, R> (EitherAsync<L, R> either, Func<R, bool> Right, Func<L, bool> Left)
- biforallAsync <L, R> (EitherAsync<L, R> either, Func<R, Task<bool>> RightAsync, Func<L, bool> Left)
- biforallAsync <L, R> (EitherAsync<L, R> either, Func<R, bool> Right, Func<L, Task<bool>> LeftAsync)
- biforallAsync <L, R> (EitherAsync<L, R> either, Func<R, Task<bool>> RightAsync, Func<L, Task<bool>> LeftAsync)
- count <L, R> (EitherAsync<L, R> either)
- exists <L, R> (EitherAsync<L, R> either, Func<R, bool> pred)
- existsAsync <L, R> (EitherAsync<L, R> either, Func<R, Task<bool>> pred)
- biexists <L, R> (EitherAsync<L, R> either, Func<R, bool> Right, Func<L, bool> Left)
- biexistsAsync <L, R> (EitherAsync<L, R> either, Func<R, Task<bool>> RightAsync, Func<L, bool> Left)
- biexistsAsync <L, R> (EitherAsync<L, R> either, Func<R, bool> Right, Func<L, Task<bool>> LeftAsync)
- biexistsAsync <L, R> (EitherAsync<L, R> either, Func<R, Task<bool>> RightAsync, Func<L, Task<bool>> LeftAsync)
- map <L, R, Ret> (EitherAsync<L, R> either, Func<R, Ret> f)
- mapAsync <L, R, Ret> (EitherAsync<L, R> either, Func<R, Task<Ret>> f)
- bimap <L, R, LRet, RRet> (EitherAsync<L, R> either, Func<R, RRet> Right, Func<L, LRet> Left)
- bimapAsync <L, R, LRet, RRet> (EitherAsync<L, R> either, Func<R, Task<RRet>> RightAsync, Func<L, LRet> Left)
- bimapAsync <L, R, LRet, RRet> (EitherAsync<L, R> either, Func<R, RRet> Right, Func<L, Task<LRet>> LeftAsync)
- bimapAsync <L, R, LRet, RRet> (EitherAsync<L, R> either, Func<R, Task<RRet>> RightAsync, Func<L, Task<LRet>> LeftAsync)
- parmap <L, T1, T2, R> (EitherAsync<L, T1> either, Func<T1, T2, R> func)
- parmap <L, T1, T2, T3, R> (EitherAsync<L, T1> either, Func<T1, T2, T3, R> func)
- filter <L, R> (EitherAsync<L, R> either, Func<R, bool> pred)
- filterAsync <L, R> (EitherAsync<L, R> either, Func<R, Task<bool>> pred)
- bind <L, R, Ret> (EitherAsync<L, R> either, Func<R, EitherAsync<L, Ret>> binder)
- match <L, R, Ret> (IEnumerable<EitherAsync<L, R>> list, Func<R, Ret> Right, Func<L, Ret> Left)
- rightToList <L, R> (EitherAsync<L, R> either)
- rightToArray <L, R> (EitherAsync<L, R> either)
- leftToList <L, R> (EitherAsync<L, R> either)
- leftToArray <L, R> (EitherAsync<L, R> either)
- rightToQuery <L, R> (EitherAsync<L, R> either)
- leftToQuery <L, R> (EitherAsync<L, R> either)
- lefts <L, R> (IEnumerable<EitherAsync<L, R>> self)
- lefts <L, R> (Seq<EitherAsync<L, R>> self)
- rights <L, R> (IEnumerable<EitherAsync<L, R>> self)
- rights <L, R> (Seq<EitherAsync<L, R>> self)
- partition <L, R> (IEnumerable<EitherAsync<L, R>> self)
- partition <L, R> (Seq<EitherAsync<L, R>> self)
struct EitherAsync <L, R> Source #
EitherAsync L R Holds one of two values 'Left' or 'Right'. Usually 'Left' is considered 'wrong' or 'in error', and 'Right' is, well, right. So when the Either is in a Left state, it cancels computations like bind or map, etc. So you can see Left as an 'early out, with a message'. Unlike Option that has None as its alternative value (i.e. it has an 'early out, but no message').
NOTE: If you use Filter or Where (or 'where' in a LINQ expression) with Either, then the Either will be put into a 'Bottom' state if the predicate returns false. When it's in this state it is neither Right nor Left. And any usage could trigger a BottomException. So be aware of the issue of filtering Either.
Also note, when the Either is in a Bottom state, some operations on it will continue to give valid results or return another Either in the Bottom state and not throw. This is so a filtered Either doesn't needlessly break expressions.
type | L | Left |
type | R | Right |
field EitherAsync<L, R> Bottom = new EitherAsync<L, R>() Source #
property Task<EitherStatus> State Source #
State of the Either You can also use: IsRight IsLeft IsBottom
property Task<bool> IsBottom Source #
Is the Either in a Bottom state? When the Either is filtered, both Right and Left are meaningless.
If you use Filter or Where (or 'where' in a LINQ expression) with Either, then the Either will be put into a 'Bottom' state if the predicate returns false. When it's in this state it is neither Right nor Left. And any usage could trigger a BottomException. So be aware of the issue of filtering Either.
Also note, when the Either is in a Bottom state, some operations on it will continue to give valid results or return another Either in the Bottom state and not throw. This is so a filtered Either doesn't needlessly break expressions.
method TaskAwaiter<Either<L, R>> GetAwaiter () Source #
Custom awaiter that turns an EitherAsync into an Either
method Task<bool> Equals <EqL, EqR> (EitherAsync<L, R> rhs) Source #
Equality operator
method Task<int> CompareTo <OrdL, OrdR> (EitherAsync<L, R> rhs) Source #
Ordering
method Task<Ret> Match <Ret> (Func<R, Ret> Right, Func<L, Ret> Left, Func<Ret> Bottom = null) Source #
Invokes the Right or Left function depending on the state of the Either
type | Ret | Return type |
param | Right | Function to invoke if in a Right state |
param | Left | Function to invoke if in a Left state |
returns | The return value of the invoked function |
method Task<Ret> MatchAsync <Ret> (Func<R, Ret> Right, Func<L, Task<Ret>> LeftAsync, Func<Ret> Bottom = null) Source #
Invokes the Right or Left function depending on the state of the Either
type | Ret | Return type |
param | Right | Function to invoke if in a Right state |
param | LeftAsync | Function to invoke if in a Left state |
returns | The return value of the invoked function |
method Task<Ret> MatchAsync <Ret> (Func<R, Task<Ret>> RightAsync, Func<L, Ret> Left, Func<Ret> Bottom = null) Source #
Invokes the Right or Left function depending on the state of the Either
type | Ret | Return type |
param | RightAsync | Function to invoke if in a Right state |
param | Left | Function to invoke if in a Left state |
returns | The return value of the invoked function |
method Task<Ret> MatchAsync <Ret> (Func<R, Task<Ret>> RightAsync, Func<L, Task<Ret>> LeftAsync, Func<Ret> Bottom = null) Source #
Invokes the Right or Left function depending on the state of the Either
type | Ret | Return type |
param | RightAsync | Function to invoke if in a Right state |
param | LeftAsync | Function to invoke if in a Left state |
returns | The return value of the invoked function |
method Task<Ret> MatchUnsafe <Ret> (Func<R, Ret> Right, Func<L, Ret> Left, Func<Ret> Bottom = null) Source #
Invokes the Right or Left function depending on the state of the Either
type | Ret | Return type |
param | Right | Function to invoke if in a Right state |
param | Left | Function to invoke if in a Left state |
returns | The return value of the invoked function |
method Task<Ret> MatchUnsafeAsync <Ret> (Func<R, Task<Ret>> RightAsync, Func<L, Ret> Left, Func<Ret> Bottom = null) Source #
Invokes the Right or Left function depending on the state of the Either
type | Ret | Return type |
param | RightAsync | Function to invoke if in a Right state |
param | Left | Function to invoke if in a Left state |
returns | The return value of the invoked function |
method Task<Ret> MatchUnsafeAsync <Ret> (Func<R, Task<Ret>> RightAsync, Func<L, Task<Ret>> LeftAsync, Func<Ret> Bottom = null) Source #
Invokes the Right or Left function depending on the state of the Either
type | Ret | Return type |
param | RightAsync | Function to invoke if in a Right state |
param | LeftAsync | Function to invoke if in a Left state |
returns | The return value of the invoked function |
method Task<Ret> MatchUnsafeAsync <Ret> (Func<R, Ret> Right, Func<L, Task<Ret>> LeftAsync, Func<Ret> Bottom = null) Source #
Invokes the Right or Left function depending on the state of the Either
type | Ret | Return type |
param | Right | Function to invoke if in a Right state |
param | LeftAsync | Function to invoke if in a Left state |
returns | The return value of the invoked function |
method Task<Unit> Match (Action<R> Right, Action<L> Left, Action Bottom = null) Source #
Invokes the Right or Left action depending on the state of the Either
param | Right | Action to invoke if in a Right state |
param | Left | Action to invoke if in a Left state |
returns | Unit |
method Task<Unit> MatchAsync (Action<R> Right, Func<L, Task> LeftAsync, Action Bottom = null) Source #
Invokes the Right or Left action depending on the state of the Either
param | Right | Action to invoke if in a Right state |
param | LeftAsync | Action to invoke if in a Left state |
returns | Unit |
method Task<Unit> MatchAsync (Func<R, Task> RightAsync, Action<L> Left, Action Bottom = null) Source #
Invokes the Right or Left action depending on the state of the Either
param | RightAsync | Action to invoke if in a Right state |
param | Left | Action to invoke if in a Left state |
returns | Unit |
method Task<Unit> MatchAsync (Func<R, Task> RightAsync, Func<L, Task> LeftAsync, Action Bottom = null) Source #
Invokes the Right or Left action depending on the state of the Either
param | RightAsync | Action to invoke if in a Right state |
param | LeftAsync | Action to invoke if in a Left state |
returns | Unit |
method Task<R> IfLeft (Func<R> Left) Source #
Executes the Left function if the Either is in a Left state. Returns the Right value if the Either is in a Right state.
param | Left | Function to generate a Right value if in the Left state |
returns | Returns an unwrapped Right value |
method Task<R> IfLeftAsync (Func<Task<R>> LeftAsync) Source #
Executes the Left function if the Either is in a Left state. Returns the Right value if the Either is in a Right state.
param | LeftAsync | Function to generate a Right value if in the Left state |
returns | Returns an unwrapped Right value |
method Task<R> IfLeft (Func<L, R> Left) Source #
Executes the leftMap function if the Either is in a Left state. Returns the Right value if the Either is in a Right state.
param | Left | Function to generate a Right value if in the Left state |
returns | Returns an unwrapped Right value |
method Task<R> IfLeftAsync (Func<L, Task<R>> LeftAsync) Source #
Executes the leftMap function if the Either is in a Left state. Returns the Right value if the Either is in a Right state.
param | LeftAsync | Function to generate a Right value if in the Left state |
returns | Returns an unwrapped Right value |
method Task<R> IfLeft (R Right) Source #
Returns the rightValue if the Either is in a Left state. Returns the Right value if the Either is in a Right state.
param | Right | Value to return if in the Left state |
returns | Returns an unwrapped Right value |
method Task<R> IfLeftAsync (Task<R> RightAsync) Source #
Returns the rightValue if the Either is in a Left state. Returns the Right value if the Either is in a Right state.
param | RightAsync | Value to return if in the Left state |
returns | Returns an unwrapped Right value |
method Task<Unit> IfLeft (Action<L> Left) Source #
Executes the Left action if the Either is in a Left state.
param | Left | Action to invoke if in the Left state |
returns | Returns an unwrapped Right value |
method Task<Unit> IfLeftAsync (Func<L, Task> LeftAsync) Source #
Executes the Left action if the Either is in a Left state.
param | LeftAsync | async Action to invoke if in the Left state |
returns | Returns an unwrapped Right value |
method Task<Unit> IfRight (Action<R> Right) Source #
Invokes the Right action if the Either is in a Right state, otherwise does nothing
param | Right | Action to invoke if in the Right state |
returns | Unit |
method Task<Unit> IfRightAsync (Func<R, Task> RightAsync) Source #
Invokes the Right action if the Either is in a Right state, otherwise does nothing
param | RightAsync | async Action to invoke if in the Right state |
returns | Unit |
method Task<L> IfRight (L Left) Source #
Returns the leftValue if the Either is in a Right state. Returns the Left value if the Either is in a Left state.
param | Left | Value to return if in the Left state |
returns | Returns an unwrapped Left value |
method Task<L> IfRight (Func<L> Right) Source #
Returns the result of Right() if the Either is in a Right state. Returns the Left value if the Either is in a Left state.
param | Right | Function to generate a Left value if in the Right state |
returns | Returns an unwrapped Left value |
method Task<L> IfRightAsync (Func<Task<L>> RightAsync) Source #
Returns the result of Right() if the Either is in a Right state. Returns the Left value if the Either is in a Left state.
param | RightAsync | Function to generate a Left value if in the Right state |
returns | Returns an unwrapped Left value |
method Task<L> IfRight (Func<R, L> Right) Source #
Returns the result of rightMap if the Either is in a Right state. Returns the Left value if the Either is in a Left state.
param | Right | Function to generate a Left value if in the Right state |
returns | Returns an unwrapped Left value |
method Task<L> IfRightAsync (Func<R, Task<L>> RightAsync) Source #
Returns the result of rightMap if the Either is in a Right state. Returns the Left value if the Either is in a Left state.
param | RightAsync | Function to generate a Left value if in the Right state |
returns | Returns an unwrapped Left value |
method EitherAsyncUnitContext<L, R> Right (Action<R> right) Source #
Match Right and return a context. You must follow this with .Left(...) to complete the match
param | right | Action to invoke if the Either is in a Right state |
returns | Context that must have Left() called upon it. |
method EitherAsyncContext<L, R, Ret> Right <Ret> (Func<R, Ret> right) Source #
Match Right and return a context. You must follow this with .Left(...) to complete the match
param | right | Action to invoke if the Either is in a Right state |
returns | Context that must have Left() called upon it. |
method string ToString () Source #
Return a string representation of the Either
returns | String representation of the Either |
method Task<string> ToStringAsync () Source #
Return a string representation of the Either
returns | String representation of the Either |
method int GetHashCode () Source #
Returns a hash code of the wrapped value of the Either
returns | Hash code |
method Task<int> GetHashCodeAsync () Source #
Returns a hash code of the wrapped value of the Either
returns | Hash code |
method Task<Lst<R>> RightToList () Source #
Project the Either into a Lst R
returns | If the Either is in a Right state, a Lst of R with one item. A zero length Lst R otherwise |
method Task<Arr<R>> RightToArray () Source #
Project the Either into an ImmutableArray R
returns | If the Either is in a Right state, a ImmutableArray of R with one item. A zero length ImmutableArray of R otherwise |
method Task<Lst<L>> LeftToList () Source #
Project the Either into a Lst R
returns | If the Either is in a Right state, a Lst of R with one item. A zero length Lst R otherwise |
method Task<Arr<L>> LeftToArray () Source #
Project the Either into an ImmutableArray R
returns | If the Either is in a Right state, a ImmutableArray of R with one item. A zero length ImmutableArray of R otherwise |
method Task<Seq<R>> RightToSeq () Source #
Convert either to sequence of 0 or 1 right values
method Task<Seq<R>> RightAsEnumerable () Source #
Project the Either into a IEnumerable R
returns | If the Either is in a Right state, a IEnumerable of R with one item. A zero length IEnumerable R otherwise |
method Task<Seq<L>> LeftAsEnumerable () Source #
Project the Either into a IEnumerable L
returns | If the Either is in a Left state, a IEnumerable of L with one item. A zero length IEnumerable L otherwise |
method Task<Validation<L, R>> ToValidation () Source #
method OptionAsync<R> ToOption () Source #
Convert the Either to an Option
returns | Some(Right) or None |
method Aff<R> ToAff (Func<L, Common.Error> Left) Source #
Convert to an Aff
param | Left | Map the left value to the Eff Error |
returns | Aff monad |
method Task<EitherUnsafe<L, R>> ToEitherUnsafe () Source #
Convert the Either to an EitherUnsafe
returns | EitherUnsafe |
method TryOptionAsync<R> ToTryOption () Source #
Convert the Either to an TryOption
returns | Some(Right) or None |
method Type GetUnderlyingRightType () Source #
Find out the underlying Right type
method Type GetUnderlyingLeftType () Source #
Find out the underlying Left type
method EitherAsync<L, R> RightAsync (Task<R> value) Source #
method Type GetUnderlyingType () Source #
method Task<int> Count () Source #
Counts the Either
type | L | Left |
type | R | Right |
param | self | Either to count |
returns | 1 if the Either is in a Right state, 0 otherwise. |
method EitherAsync<R, L> Swap () Source #
Flips the left and right tagged values
returns | Either with the types swapped |
method Task<Unit> Iter (Action<R> Right) Source #
Iterate the Either action is invoked if in the Right state
method Task<Unit> BiIter (Action<R> Right, Action<L> Left) Source #
Iterate the Either action is invoked if in the Right state
method Task<bool> ForAll (Func<R, bool> Right) Source #
Invokes a predicate on the value of the Either if it's in the Right state
type | L | Left |
type | R | Right |
param | self | Either to forall |
param | Right | Predicate |
returns | True if the Either is in a Left state. True if the Either is in a Right state and the predicate returns True. False otherwise. |
method Task<bool> ForAllAsync (Func<R, Task<bool>> Right) Source #
Invokes a predicate on the value of the Either if it's in the Right state
type | L | Left |
type | R | Right |
param | self | Either to forall |
param | Right | Predicate |
returns | True if the Either is in a Left state. True if the Either is in a Right state and the predicate returns True. False otherwise. |
method Task<bool> BiForAll (Func<R, bool> Right, Func<L, bool> Left) Source #
Invokes a predicate on the value of the Either if it's in the Right state
type | L | Left |
type | R | Right |
param | self | Either to forall |
param | Right | Predicate |
param | Left | Predicate |
returns | True if either Predicate returns true |
method Task<bool> BiForAllAsync (Func<R, Task<bool>> RightAsync, Func<L, bool> Left) Source #
Invokes a predicate on the value of the Either if it's in the Right state
type | L | Left |
type | R | Right |
param | self | Either to forall |
param | RightAsync | Predicate |
param | Left | Predicate |
returns | True if either Predicate returns true |
method Task<bool> BiForAllAsync (Func<R, bool> Right, Func<L, Task<bool>> LeftAsync) Source #
Invokes a predicate on the value of the Either if it's in the Right state
type | L | Left |
type | R | Right |
param | self | Either to forall |
param | Right | Predicate |
param | LeftAsync | Predicate |
returns | True if either Predicate returns true |
method Task<bool> BiForAllAsync (Func<R, Task<bool>> RightAsync, Func<L, Task<bool>> LeftAsync) Source #
Invokes a predicate on the value of the Either if it's in the Right state
type | L | Left |
type | R | Right |
param | self | Either to forall |
param | RightAsync | Predicate |
param | LeftAsync | Predicate |
returns | True if either Predicate returns true |
method Task<S> Fold <S> (S state, Func<S, R, S> Right) Source #
Either types are like lists of 0 or 1 items, and therefore follow the same rules when folding.
In the case of lists, 'Fold', when applied to a binary operator, a starting value(typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:
type | S | Aggregate state type |
param | state | Initial state |
param | Right | Folder function, applied if structure is in a Right state |
returns | The aggregate state |
method Task<S> FoldAsync <S> (S state, Func<S, R, Task<S>> RightAsync) Source #
Either types are like lists of 0 or 1 items, and therefore follow the same rules when folding.
In the case of lists, 'Fold', when applied to a binary operator, a starting value(typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:
type | S | Aggregate state type |
param | state | Initial state |
param | RightAsync | Folder function, applied if structure is in a Right state |
returns | The aggregate state |
method Task<S> BiFold <S> (S state, Func<S, R, S> Right, Func<S, L, S> Left) Source #
Either types are like lists of 0 or 1 items, and therefore follow the same rules when folding.
In the case of lists, 'Fold', when applied to a binary operator, a starting value(typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:
type | S | Aggregate state type |
param | state | Initial state |
param | Right | Folder function, applied if Either is in a Right state |
param | Left | Folder function, applied if Either is in a Left state |
returns | The aggregate state |
method Task<S> BiFoldAsync <S> (S state, Func<S, R, Task<S>> RightAsync, Func<S, L, S> Left) Source #
Either types are like lists of 0 or 1 items, and therefore follow the same rules when folding.
In the case of lists, 'Fold', when applied to a binary operator, a starting value(typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:
type | S | Aggregate state type |
param | state | Initial state |
param | RightAsync | Folder function, applied if Either is in a Right state |
param | Left | Folder function, applied if Either is in a Left state |
returns | The aggregate state |
method Task<S> BiFoldAsync <S> (S state, Func<S, R, Task<S>> RightAsync, Func<S, L, Task<S>> LeftAsync) Source #
Either types are like lists of 0 or 1 items, and therefore follow the same rules when folding.
In the case of lists, 'Fold', when applied to a binary operator, a starting value(typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:
type | S | Aggregate state type |
param | state | Initial state |
param | RightAsync | Folder function, applied if Either is in a Right state |
param | LeftAsync | Folder function, applied if Either is in a Left state |
returns | The aggregate state |
method Task<S> BiFoldAsync <S> (S state, Func<S, R, S> Right, Func<S, L, Task<S>> LeftAsync) Source #
Either types are like lists of 0 or 1 items, and therefore follow the same rules when folding.
In the case of lists, 'Fold', when applied to a binary operator, a starting value(typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:
type | S | Aggregate state type |
param | state | Initial state |
param | Right | Folder function, applied if Either is in a Right state |
param | LeftAsync | Folder function, applied if Either is in a Left state |
returns | The aggregate state |
method Task<bool> Exists (Func<R, bool> pred) Source #
Invokes a predicate on the value of the Either if it's in the Right state
type | L | Left |
type | R | Right |
param | self | Either to check existence of |
param | pred | Predicate |
returns | True if the Either is in a Right state and the predicate returns True. False otherwise. |
method Task<bool> ExistsAsync (Func<R, Task<bool>> pred) Source #
Invokes a predicate on the value of the Either if it's in the Right state
type | L | Left |
type | R | Right |
param | self | Either to check existence of |
param | pred | Predicate |
returns | True if the Either is in a Right state and the predicate returns True. False otherwise. |
method Task<bool> BiExists (Func<R, bool> Right, Func<L, bool> Left) Source #
Invokes a predicate on the value of the Either
type | L | Left |
type | R | Right |
param | self | Either to check existence of |
param | Right | Right predicate |
param | Left | Left predicate |
returns | True if the predicate returns True. False otherwise or if the Either is in a bottom state. |
method Task<bool> BiExistsAsync (Func<R, Task<bool>> RightAsync, Func<L, bool> Left) Source #
Invokes a predicate on the value of the Either
type | L | Left |
type | R | Right |
param | self | Either to check existence of |
param | RightAsync | Right predicate |
param | Left | Left predicate |
returns | True if the predicate returns True. False otherwise or if the Either is in a bottom state. |
method Task<bool> BiExistsAsync (Func<R, Task<bool>> RightAsync, Func<L, Task<bool>> LeftAsync) Source #
Invokes a predicate on the value of the Either
type | L | Left |
type | R | Right |
param | self | Either to check existence of |
param | RightAsync | Right predicate |
param | LeftAsync | Left predicate |
returns | True if the predicate returns True. False otherwise or if the Either is in a bottom state. |
method Task<bool> BiExistsAsync (Func<R, bool> Right, Func<L, Task<bool>> LeftAsync) Source #
Invokes a predicate on the value of the Either
type | L | Left |
type | R | Right |
param | self | Either to check existence of |
param | Right | Right predicate |
param | LeftAsync | Left predicate |
returns | True if the predicate returns True. False otherwise or if the Either is in a bottom state. |
method EitherAsync<L, R> Do (Action<R> f) Source #
Impure iteration of the bound values in the structure
returns | Returns the original unmodified structure |
method EitherAsync<L, Ret> Map <Ret> (Func<R, Ret> f) Source #
Maps the value in the Either if it's in a Right state
type | L | Left |
type | R | Right |
type | Ret | Mapped Either type |
param | self | Either to map |
param | f | Map function |
returns | Mapped Either |
method EitherAsync<L, Ret> MapAsync <Ret> (Func<R, Task<Ret>> f) Source #
Maps the value in the Either if it's in a Right state
type | L | Left |
type | R | Right |
type | Ret | Mapped Either type |
param | self | Either to map |
param | mapper | Map function |
returns | Mapped Either |
method EitherAsync<Ret, R> MapLeft <Ret> (Func<L, Ret> f) Source #
Maps the value in the Either if it's in a Left state
type | L | Left |
type | R | Right |
type | Ret | Mapped Either type |
param | self | Either to map |
param | f | Map function |
returns | Mapped Either |
method EitherAsync<Ret, R> MapLeftAsync <Ret> (Func<L, Task<Ret>> f) Source #
Maps the value in the Either if it's in a Left state
type | L | Left |
type | R | Right |
type | Ret | Mapped Either type |
param | self | Either to map |
param | f | Map function |
returns | Mapped Either |
method EitherAsync<L, Ret> BiMapAsync <Ret> (Func<R, Task<Ret>> RightAsync, Func<L, Ret> Left) Source #
Bi-maps the value in the Either into a Right state
type | L | Left |
type | R | Right |
type | LRet | Left return |
type | RRet | Right return |
param | self | Either to map |
param | RightAsync | Right map function |
param | Left | Left map function |
returns | Mapped Either |
method EitherAsync<L, Ret> BiMapAsync <Ret> (Func<R, Ret> Right, Func<L, Task<Ret>> LeftAsync) Source #
Bi-maps the value in the Either into a Right state
type | L | Left |
type | R | Right |
type | LRet | Left return |
type | RRet | Right return |
param | self | Either to map |
param | Right | Right map function |
param | LeftAsync | Left map function |
returns | Mapped Either |
method EitherAsync<L2, R2> BiMap <L2, R2> (Func<R, R2> Right, Func<L, L2> Left) Source #
Bi-maps the value in the Either if it's in a Right state
type | L | Left |
type | R | Right |
type | LRet | Left return |
type | RRet | Right return |
param | self | Either to map |
param | Right | Right map function |
param | Left | Left map function |
returns | Mapped Either |
method EitherAsync<L2, R2> BiMapAsync <L2, R2> (Func<R, Task<R2>> RightAsync, Func<L, L2> Left) Source #
Bi-maps the value in the Either if it's in a Right state
type | L | Left |
type | R | Right |
type | LRet | Left return |
type | RRet | Right return |
param | self | Either to map |
param | RightAsync | Right map function |
param | Left | Left map function |
returns | Mapped Either |
method EitherAsync<L2, R2> BiMapAsync <L2, R2> (Func<R, R2> Right, Func<L, Task<L2>> LeftAsync) Source #
Bi-maps the value in the Either if it's in a Right state
type | L | Left |
type | R | Right |
type | LRet | Left return |
type | RRet | Right return |
param | self | Either to map |
param | Right | Right map function |
param | LeftAsync | Left map function |
returns | Mapped Either |
method EitherAsync<L2, R2> BiMapAsync <L2, R2> (Func<R, Task<R2>> RightAsync, Func<L, Task<L2>> LeftAsync) Source #
Bi-maps the value in the Either if it's in a Right state
type | L | Left |
type | R | Right |
type | LRet | Left return |
type | RRet | Right return |
param | self | Either to map |
param | RightAsync | Right map function |
param | LeftAsync | Left map function |
returns | Mapped Either |
method EitherAsync<L, Ret> Bind <Ret> (Func<R, EitherAsync<L, Ret>> f) Source #
Monadic bind
type | L | Left |
type | R | Right |
type | Ret | |
param | self | |
param | f | |
returns | Bound Either |
method EitherAsync<L, Ret> BindAsync <Ret> (Func<R, Task<EitherAsync<L, Ret>>> f) Source #
Monadic bind
type | L | Left |
type | R | Right |
type | Ret | |
param | self | |
param | f | |
returns | Bound Either |
method EitherAsync<L, B> BiBind <B> (Func<R, EitherAsync<L, B>> Right, Func<L, EitherAsync<L, B>> Left) Source #
Bi-bind. Allows mapping of both monad states
method EitherAsync<L, B> BiBindAsync <B> (Func<R, Task<EitherAsync<L, B>>> RightAsync, Func<L, EitherAsync<L, B>> Left) Source #
Bi-bind. Allows mapping of both monad states
method EitherAsync<L, B> BiBindAsync <B> (Func<R, EitherAsync<L, B>> Right, Func<L, Task<EitherAsync<L, B>>> LeftAsync) Source #
Bi-bind. Allows mapping of both monad states
method EitherAsync<L, B> BiBindAsync <B> (Func<R, Task<EitherAsync<L, B>>> RightAsync, Func<L, Task<EitherAsync<L, B>>> LeftAsync) Source #
Bi-bind. Allows mapping of both monad states
method EitherAsync<B, R> BindLeft <B> (Func<L, EitherAsync<B, R>> Left) Source #
Bind left. Binds the left path of the monad only
method EitherAsync<B, R> BindLeftAsync <B> (Func<L, Task<EitherAsync<B, R>>> LeftAsync) Source #
Bind left. Binds the left path of the monad only
method EitherAsync<L, R> Filter (Func<R, bool> pred) Source #
Filter the Either
This may give unpredictable results for a filtered value. The Either won't return true for IsLeft or IsRight. IsBottom is True if the value is filtered and that should be checked for.
type | L | Left |
type | R | Right |
param | self | Either to filter |
param | pred | Predicate function |
returns | If the Either is in the Left state it is returned as-is. If in the Right state the predicate is applied to the Right value. If the predicate returns True the Either is returned as-is. If the predicate returns False the Either is returned in a 'Bottom' state. |
method EitherAsync<L, R> FilterAsync (Func<R, Task<bool>> pred) Source #
Filter the Either
This may give unpredictable results for a filtered value. The Either won't return true for IsLeft or IsRight. IsBottom is True if the value is filtered and that should be checked for.
type | L | Left |
type | R | Right |
param | self | Either to filter |
param | pred | Predicate function |
returns | If the Either is in the Left state it is returned as-is. If in the Right state the predicate is applied to the Right value. If the predicate returns True the Either is returned as-is. If the predicate returns False the Either is returned in a 'Bottom' state. |
method EitherAsync<L, R> Where (Func<R, bool> pred) Source #
Filter the Either
This may give unpredictable results for a filtered value. The Either won't return true for IsLeft or IsRight. IsBottom is True if the value is filtered and that should be checked for.
type | L | Left |
type | R | Right |
param | self | Either to filter |
param | pred | Predicate function |
returns | If the Either is in the Left state it is returned as-is. If in the Right state the predicate is applied to the Right value. If the predicate returns True the Either is returned as-is. If the predicate returns False the Either is returned in a 'Bottom' state. IsLeft will return True, but the value of Left = default(L) |
method EitherAsync<L, U> Select <U> (Func<R, U> map) Source #
Maps the value in the Either if it's in a Right state
type | L | Left |
type | TR | Right |
type | UR | Mapped Either type |
param | self | Either to map |
param | map | Map function |
returns | Mapped Either |
method EitherAsync<L, V> SelectMany <U, V> (Func<R, EitherAsync<L, U>> bind, Func<R, U, V> project) Source #
Monadic bind function
returns | Bound Either |
method IAsyncEnumerator<R> GetAsyncEnumerator (CancellationToken cancellationToken = default) Source #
Enumerate asynchronously
struct EitherAsyncContext <L, R, Ret> Source #
Context for the fluent EitherAsync matching
struct EitherAsyncUnitContext <L, R> Source #
Context for the fluent EitherAsync matching
class EitherAsyncExtensions Source #
Extension methods for Either
method EitherAsync<L, R> Flatten <L, R> (this EitherAsync<L, EitherAsync<L, R>> ma) Source #
Monadic join
method EitherAsync<L, R> Flatten <L, R> (this EitherAsync<EitherAsync<L, R>, EitherAsync<L, R>> ma) Source #
Monadic join
method EitherAsync<L, R> Plus <NUM, L, R> (this EitherAsync<L, R> x, EitherAsync<L, R> y) Source #
Add the bound values of x and y, uses an Add type-class to provide the add operation for type A. For example x.Add<TInteger,int>(y)
type | NUM | Num of A |
type | A | Bound value type |
param | x | Left hand side of the operation |
param | y | Right hand side of the operation |
returns | An option with y added to x |
method EitherAsync<L, R> Subtract <NUM, L, R> (this EitherAsync<L, R> x, EitherAsync<L, R> y) Source #
Find the subtract between the two bound values of x and y, uses a Subtract type-class to provide the subtract operation for type A. For example x.Subtract<TInteger,int>(y)
type | NUM | Num of A |
type | A | Bound value type |
param | x | Left hand side of the operation |
param | y | Right hand side of the operation |
returns | An option with the subtract between x and y |
method EitherAsync<L, R> Product <NUM, L, R> (this EitherAsync<L, R> x, EitherAsync<L, R> y) Source #
Find the product between the two bound values of x and y, uses a Product type-class to provide the product operation for type A. For example x.Product<TInteger,int>(y)
type | NUM | Num of A |
type | A | Bound value type |
param | x | Left hand side of the operation |
param | y | Right hand side of the operation |
returns | An option with the product of x and y |
method EitherAsync<L, R> Divide <NUM, L, R> (this EitherAsync<L, R> x, EitherAsync<L, R> y) Source #
Divide the two bound values of x and y, uses a Divide type-class to provide the divide operation for type A. For example x.Divide<TDouble,double>(y)
type | NUM | Num of A |
type | A | Bound value type |
param | x | Left hand side of the operation |
param | y | Right hand side of the operation |
returns | An option x / y |
method EitherAsync<L, B> Apply <L, A, B> (this EitherAsync<L, Func<A, B>> fab, EitherAsync<L, A> fa) Source #
Apply
param | fab | Function to apply the applicative to |
param | fa | Applicative to apply |
returns | Applicative of type FB derived from Applicative of B |
method EitherAsync<L, B> Apply <L, A, B> (this Func<A, B> fab, EitherAsync<L, A> fa) Source #
Apply
param | fab | Function to apply the applicative to |
param | fa | Applicative to apply |
returns | Applicative of type FB derived from Applicative of B |
method EitherAsync<L, C> Apply <L, A, B, C> (this EitherAsync<L, Func<A, B, C>> fabc, EitherAsync<L, A> fa, EitherAsync<L, B> fb) Source #
Apply
param | fab | Function to apply the applicative to |
param | fa | Applicative a to apply |
param | fb | Applicative b to apply |
returns | Applicative of type FC derived from Applicative of C |
method EitherAsync<L, C> Apply <L, A, B, C> (this Func<A, B, C> fabc, EitherAsync<L, A> fa, EitherAsync<L, B> fb) Source #
Apply
param | fab | Function to apply the applicative to |
param | fa | Applicative a to apply |
param | fb | Applicative b to apply |
returns | Applicative of type FC derived from Applicative of C |
method EitherAsync<L, Func<B, C>> Apply <L, A, B, C> (this EitherAsync<L, Func<A, B, C>> fabc, EitherAsync<L, A> fa) Source #
Apply
param | fab | Function to apply the applicative to |
param | fa | Applicative to apply |
returns | Applicative of type f(b -> c) derived from Applicative of Func<B, C> |
method EitherAsync<L, Func<B, C>> Apply <L, A, B, C> (this Func<A, B, C> fabc, EitherAsync<L, A> fa) Source #
Apply
param | fab | Function to apply the applicative to |
param | fa | Applicative to apply |
returns | Applicative of type f(b -> c) derived from Applicative of Func<B, C> |
method EitherAsync<L, Func<B, C>> Apply <L, A, B, C> (this EitherAsync<L, Func<A, Func<B, C>>> fabc, EitherAsync<L, A> fa) Source #
Apply
param | fab | Function to apply the applicative to |
param | fa | Applicative to apply |
returns | Applicative of type f(b -> c) derived from Applicative of Func<B, C> |
method EitherAsync<L, Func<B, C>> Apply <L, A, B, C> (this Func<A, Func<B, C>> fabc, EitherAsync<L, A> fa) Source #
Apply
param | fab | Function to apply the applicative to |
param | fa | Applicative to apply |
returns | Applicative of type f(b -> c) derived from Applicative of Func<B, C> |
method EitherAsync<L, B> Action <L, A, B> (this EitherAsync<L, A> fa, EitherAsync<L, B> fb) Source #
Evaluate fa, then fb, ignoring the result of fa
param | fa | Applicative to evaluate first |
param | fb | Applicative to evaluate second and then return |
returns | Applicative of type Option |
method Task<IEnumerable<L>> Lefts <L, R> (this IEnumerable<EitherAsync<L, R>> self) Source #
Extracts from a list of 'Either' all the 'Left' elements. All the 'Left' elements are extracted in order.
type | L | Left |
type | R | Right |
param | self | Either list |
returns | An enumerable of L |
method Task<Seq<L>> Lefts <L, R> (this Seq<EitherAsync<L, R>> self) Source #
Extracts from a list of 'Either' all the 'Left' elements. All the 'Left' elements are extracted in order.
type | L | Left |
type | R | Right |
param | self | Either list |
returns | An enumerable of L |
method Task<IEnumerable<R>> Rights <L, R> (this IEnumerable<EitherAsync<L, R>> self) Source #
Extracts from a list of 'Either' all the 'Right' elements. All the 'Right' elements are extracted in order.
type | L | Left |
type | R | Right |
param | self | Either list |
returns | An enumerable of L |
method Task<Seq<R>> Rights <L, R> (this Seq<EitherAsync<L, R>> self) Source #
Extracts from a list of 'Either' all the 'Right' elements. All the 'Right' elements are extracted in order.
type | L | Left |
type | R | Right |
param | self | Either list |
returns | An enumerable of L |
method Task<(Seq<L> Lefts, Seq<R> Rights)> Partition <L, R> (this Seq<EitherAsync<L, R>> self) Source #
Partitions a list of 'Either' into two lists. All the 'Left' elements are extracted, in order, to the first component of the output. Similarly the 'Right' elements are extracted to the second component of the output.
type | L | Left |
type | R | Right |
param | self | Either list |
returns | A tuple containing the an enumerable of L and an enumerable of R |
method Task<(IEnumerable<L> Lefts, IEnumerable<R> Rights)> Partition <L, R> (this IEnumerable<EitherAsync<L, R>> self) Source #
Partitions a list of 'Either' into two lists. All the 'Left' elements are extracted, in order, to the first component of the output. Similarly the 'Right' elements are extracted to the second component of the output.
type | L | Left |
type | R | Right |
param | self | Either list |
returns | A tuple containing the an enumerable of L and an enumerable of R |
method Task<R> Sum <NUM, L, R> (this EitherAsync<L, R> self) Source #
Sum of the Either
type | L | Left |
param | self | Either to count |
returns | 0 if Left, or value of Right |
method Task<int> Sum <L> (this EitherAsync<L, int> self) Source #
Sum of the Either
type | L | Left |
param | self | Either to count |
returns | 0 if Left, or value of Right |
method EitherAsync<L, Func<T2, R>> ParMap <L, T1, T2, R> (this EitherAsync<L, T1> self, Func<T1, T2, R> func) Source #
Partial application map
class EitherAsyncGuardExtensions Source #
method EitherAsync<L, Unit> ToEitherAsync <L> (this Guard<L> ma) Source #
method EitherAsync<L, B> SelectMany <L, B> (this Guard<L> ma, Func<Unit, EitherAsync<L, B>> f) Source #
method EitherAsync<L, C> SelectMany <L, B, C> (this Guard<L> ma, Func<Unit, EitherAsync<L, B>> bind, Func<Unit, B, C> project) Source #
method EitherAsync<L, Unit> SelectMany <L, A> (this EitherAsync<L, A> ma, Func<A, Guard<L>> f) Source #
method EitherAsync<L, C> SelectMany <L, A, C> (this EitherAsync<L, A> ma, Func<A, Guard<L>> bind, Func<A, Unit, C> project) Source #
method EitherAsync<L, R> flatten <L, R> (EitherAsync<L, EitherAsync<L, R>> ma) Source #
Monadic join
method EitherAsync<L, R> plus <NUM, L, R> (EitherAsync<L, R> x, EitherAsync<L, R> y) Source #
Add the bound values of x and y, uses an Add type-class to provide the add operation for type A. For example x.Add<TInteger,int>(y)
type | NUM | Num of A |
type | A | Bound value type |
param | x | Left hand side of the operation |
param | y | Right hand side of the operation |
returns | An option with y added to x |
method EitherAsync<L, R> subtract <NUM, L, R> (EitherAsync<L, R> x, EitherAsync<L, R> y) Source #
Find the subtract between the two bound values of x and y, uses a Subtract type-class to provide the subtract operation for type A. For example x.Subtract<TInteger,int>(y)
type | NUM | Num of A |
type | A | Bound value type |
param | x | Left hand side of the operation |
param | y | Right hand side of the operation |
returns | An option with the subtract between x and y |
method EitherAsync<L, R> product <NUM, L, R> (EitherAsync<L, R> x, EitherAsync<L, R> y) Source #
Find the product between the two bound values of x and y, uses a Product type-class to provide the product operation for type A. For example x.Product<TInteger,int>(y)
type | NUM | Num of A |
type | A | Bound value type |
param | x | Left hand side of the operation |
param | y | Right hand side of the operation |
returns | An option with the product of x and y |
method EitherAsync<L, R> divide <NUM, L, R> (EitherAsync<L, R> x, EitherAsync<L, R> y) Source #
Divide the two bound values of x and y, uses a Divide type-class to provide the divide operation for type A. For example x.Divide<TDouble,double>(y)
type | NUM | Num of A |
type | A | Bound value type |
param | x | Left hand side of the operation |
param | y | Right hand side of the operation |
returns | An option x / y |
method EitherAsync<L, B> apply <L, A, B> (EitherAsync<L, Func<A, B>> fab, EitherAsync<L, A> fa) Source #
Apply
param | fab | Function to apply the applicative to |
param | fa | Applicative to apply |
returns | Applicative of type FB derived from Applicative of B |
method EitherAsync<L, B> apply <L, A, B> (Func<A, B> fab, EitherAsync<L, A> fa) Source #
Apply
param | fab | Function to apply the applicative to |
param | fa | Applicative to apply |
returns | Applicative of type FB derived from Applicative of B |
method EitherAsync<L, C> apply <L, A, B, C> (EitherAsync<L, Func<A, B, C>> fabc, EitherAsync<L, A> fa, EitherAsync<L, B> fb) Source #
Apply
param | fab | Function to apply the applicative to |
param | fa | Applicative a to apply |
param | fb | Applicative b to apply |
returns | Applicative of type FC derived from Applicative of C |
method EitherAsync<L, C> apply <L, A, B, C> (Func<A, B, C> fabc, EitherAsync<L, A> fa, EitherAsync<L, B> fb) Source #
Apply
param | fab | Function to apply the applicative to |
param | fa | Applicative a to apply |
param | fb | Applicative b to apply |
returns | Applicative of type FC derived from Applicative of C |
method EitherAsync<L, Func<B, C>> apply <L, A, B, C> (EitherAsync<L, Func<A, B, C>> fabc, EitherAsync<L, A> fa) Source #
Apply
param | fab | Function to apply the applicative to |
param | fa | Applicative to apply |
returns | Applicative of type f(b -> c) derived from Applicative of Func<B, C> |
method EitherAsync<L, Func<B, C>> apply <L, A, B, C> (Func<A, B, C> fabc, EitherAsync<L, A> fa) Source #
Apply
param | fab | Function to apply the applicative to |
param | fa | Applicative to apply |
returns | Applicative of type f(b -> c) derived from Applicative of Func<B, C> |
method EitherAsync<L, Func<B, C>> apply <L, A, B, C> (EitherAsync<L, Func<A, Func<B, C>>> fabc, EitherAsync<L, A> fa) Source #
Apply
param | fab | Function to apply the applicative to |
param | fa | Applicative to apply |
returns | Applicative of type f(b -> c) derived from Applicative of Func<B, C> |
method EitherAsync<L, Func<B, C>> apply <L, A, B, C> (Func<A, Func<B, C>> fabc, EitherAsync<L, A> fa) Source #
Apply
param | fab | Function to apply the applicative to |
param | fa | Applicative to apply |
returns | Applicative of type f(b -> c) derived from Applicative of Func<B, C> |
method EitherAsync<L, B> action <L, A, B> (EitherAsync<L, A> fa, EitherAsync<L, B> fb) Source #
Evaluate fa, then fb, ignoring the result of fa
param | fa | Applicative to evaluate first |
param | fb | Applicative to evaluate second and then return |
returns | Applicative of type Option |
method Task<bool> isRight <L, R> (EitherAsync<L, R> value) Source #
Returns the state of the Either provided
type | L | Left |
type | R | Right |
param | value | Either to check |
returns | True if the Either is in a Right state |
method Task<bool> isLeft <L, R> (EitherAsync<L, R> value) Source #
Returns the state of the Either provided
type | L | Left |
type | R | Right |
param | value | Either to check |
returns | True if the Either is in a Left state |
method EitherAsync<L, R> RightAsync <L, R> (Task<R> value) Source #
Either constructor Constructs an Either in a Right state
type | L | Left |
type | R | Right |
param | value | Right value |
returns | A new Either instance |
method EitherAsync<L, R> RightAsync <L, R> (Func<Unit, Task<R>> value) Source #
Either constructor Constructs an Either in a Right state
type | L | Left |
type | R | Right |
param | value | Right value |
returns | A new Either instance |
method EitherAsync<L, R> RightAsync <L, R> (R value) Source #
Either constructor Constructs an Either in a Right state
type | L | Left |
type | R | Right |
param | value | Right value |
returns | A new Either instance |
method EitherAsync<L, R> LeftAsync <L, R> (Task<L> value) Source #
Either constructor Constructs an Either in a Left state
type | L | Left |
type | R | Right |
param | value | Left value |
returns | A new Either instance |
method EitherAsync<L, R> LeftAsync <L, R> (Func<Unit, Task<L>> value) Source #
Either constructor Constructs an Either in a Left state
type | L | Left |
type | R | Right |
param | value | Left value |
returns | A new Either instance |
method EitherAsync<L, R> LeftAsync <L, R> (L value) Source #
Either constructor Constructs an Either in a Left state
type | L | Left |
type | R | Right |
param | value | Left value |
returns | A new Either instance |
method Task<R> ifLeft <L, R> (EitherAsync<L, R> either, Func<R> LeftSync) Source #
Executes the Left function if the Either is in a Left state. Returns the Right value if the Either is in a Right state.
param | Left | Function to generate a Right value if in the Left state |
returns | Returns an unwrapped Right value |
method Task<R> ifLeft <L, R> (EitherAsync<L, R> either, Func<L, R> LeftSync) Source #
Executes the leftMap function if the Either is in a Left state. Returns the Right value if the Either is in a Right state.
param | leftMap | Function to generate a Right value if in the Left state |
returns | Returns an unwrapped Right value |
method Task<R> ifLeftAsync <L, R> (EitherAsync<L, R> either, Func<L, Task<R>> LeftAsync) Source #
Executes the leftMap function if the Either is in a Left state. Returns the Right value if the Either is in a Right state.
param | leftMap | Function to generate a Right value if in the Left state |
returns | Returns an unwrapped Right value |
method Task<R> ifLeft <L, R> (EitherAsync<L, R> either, R Right) Source #
Returns the rightValue if the Either is in a Left state. Returns the Right value if the Either is in a Right state.
param | rightValue | Value to return if in the Left state |
returns | Returns an unwrapped Right value |
method Task<Unit> ifLeft <L, R> (EitherAsync<L, R> either, Action<L> Left) Source #
Executes the Left action if the Either is in a Left state.
param | Left | Function to generate a Right value if in the Left state |
returns | Returns an unwrapped Right value |
method Task<Unit> ifLeftAsync <L, R> (EitherAsync<L, R> either, Func<L, Task> Left) Source #
Executes the Left action if the Either is in a Left state.
param | Left | Function to generate a Right value if in the Left state |
returns | Returns an unwrapped Right value |
method Task<Unit> ifRight <L, R> (EitherAsync<L, R> either, Action<R> Right) Source #
Invokes the Right action if the Either is in a Right state, otherwise does nothing
param | Right | Action to invoke |
returns | Unit |
method Task<Unit> ifRightAsync <L, R> (EitherAsync<L, R> either, Func<R, Task> RightAsync) Source #
Invokes the Right action if the Either is in a Right state, otherwise does nothing
param | Right | Action to invoke |
returns | Unit |
method Task<L> ifRight <L, R> (EitherAsync<L, R> either, L Left) Source #
Returns the Left
argument if the Either
is in a Right
state.
Returns the Left
value from the Either if it's in a Left
state.
param | Left | Value to return if in the Left state |
returns | Returns an unwrapped Left value |
method Task<L> ifRightAsync <L, R> (EitherAsync<L, R> either, Func<Task<L>> RightAsync) Source #
Returns the Left
argument if the Either
is in a Right
state.
Returns the Left
value from the Either if it's in a Left
state.
param | Left | Value to return if in the Left state |
returns | Returns an unwrapped Left value |
method Task<L> ifRight <L, R> (EitherAsync<L, R> either, Func<L> Left) Source #
Returns the result of Left() if the Either is in a Right state. Returns the Left value if the Either is in a Left state.
param | Left | Function to generate a Left value if in the Right state |
returns | Returns an unwrapped Left value |
method Task<L> ifRight <L, R> (EitherAsync<L, R> either, Func<R, L> Left) Source #
Returns the result of Left if the Either is in a Right state. Returns the Left value if the Either is in a Left state.
param | Left | Function to generate a Left value if in the Right state |
returns | Returns an unwrapped Left value |
method Task<L> ifRightAsync <L, R> (EitherAsync<L, R> either, Func<R, Task<L>> LeftAsync) Source #
Returns the result of Left if the Either is in a Right state. Returns the Left value if the Either is in a Left state.
param | Left | Function to generate a Left value if in the Right state |
returns | Returns an unwrapped Left value |
method Task<Ret> match <L, R, Ret> (EitherAsync<L, R> either, Func<R, Ret> Right, Func<L, Ret> Left, Func<Ret> Bottom = null) Source #
Invokes the Right or Left function depending on the state of the Either provided
type | L | Left |
type | R | Right |
type | Ret | Return type |
param | either | Either to match |
param | Right | Function to invoke if in a Right state |
param | Left | Function to invoke if in a Left state |
returns | The return value of the invoked function |
method Task<Ret> matchAsync <L, R, Ret> (EitherAsync<L, R> either, Func<R, Task<Ret>> RightAsync, Func<L, Ret> Left, Func<Ret> Bottom = null) Source #
Invokes the Right or Left function depending on the state of the Either provided
type | L | Left |
type | R | Right |
type | Ret | Return type |
param | either | Either to match |
param | Right | Function to invoke if in a Right state |
param | Left | Function to invoke if in a Left state |
returns | The return value of the invoked function |
method Task<Ret> matchAsync <L, R, Ret> (EitherAsync<L, R> either, Func<R, Ret> Right, Func<L, Task<Ret>> LeftAsync, Func<Ret> Bottom = null) Source #
Invokes the Right or Left function depending on the state of the Either provided
type | L | Left |
type | R | Right |
type | Ret | Return type |
param | either | Either to match |
param | Right | Function to invoke if in a Right state |
param | Left | Function to invoke if in a Left state |
returns | The return value of the invoked function |
method Task<Ret> matchAsync <L, R, Ret> (EitherAsync<L, R> either, Func<R, Task<Ret>> RightAsync, Func<L, Task<Ret>> LeftAsync, Func<Ret> Bottom = null) Source #
Invokes the Right or Left function depending on the state of the Either provided
type | L | Left |
type | R | Right |
type | Ret | Return type |
param | either | Either to match |
param | Right | Function to invoke if in a Right state |
param | Left | Function to invoke if in a Left state |
returns | The return value of the invoked function |
method Task<Unit> match <L, R> (EitherAsync<L, R> either, Action<R> Right, Action<L> Left, Action Bottom = null) Source #
Invokes the Right or Left action depending on the state of the Either provided
type | L | Left |
type | R | Right |
param | either | Either to match |
param | Right | Action to invoke if in a Right state |
param | Left | Action to invoke if in a Left state |
returns | Unit |
method Task<Unit> matchAsync <L, R> (EitherAsync<L, R> either, Func<R, Task> RightAsync, Action<L> Left, Action Bottom = null) Source #
Invokes the Right or Left action depending on the state of the Either provided
type | L | Left |
type | R | Right |
param | either | Either to match |
param | Right | Action to invoke if in a Right state |
param | Left | Action to invoke if in a Left state |
returns | Unit |
method Task<Unit> matchAsync <L, R> (EitherAsync<L, R> either, Action<R> Right, Func<L, Task> LeftAsync, Action Bottom = null) Source #
Invokes the Right or Left action depending on the state of the Either provided
type | L | Left |
type | R | Right |
param | either | Either to match |
param | Right | Action to invoke if in a Right state |
param | Left | Action to invoke if in a Left state |
returns | Unit |
method Task<Unit> matchAsync <L, R> (EitherAsync<L, R> either, Func<R, Task> RightAsync, Func<L, Task> LeftAsync, Action Bottom = null) Source #
Invokes the Right or Left action depending on the state of the Either provided
type | L | Left |
type | R | Right |
param | either | Either to match |
param | Right | Action to invoke if in a Right state |
param | Left | Action to invoke if in a Left state |
returns | Unit |
method Task<S> fold <S, L, R> (EitherAsync<L, R> either, S state, Func<S, R, S> Right) Source #
Either types are like lists of 0 or 1 items, and therefore follow the same rules when folding.
In the case of lists, 'Fold', when applied to a binary operator, a starting value(typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:
type | S | Aggregate state type |
param | state | Initial state |
param | Right | Folder function, applied if structure is in a Right state |
returns | The aggregate state |
method Task<S> foldAsync <S, L, R> (EitherAsync<L, R> either, S state, Func<S, R, Task<S>> RightAsync) Source #
Either types are like lists of 0 or 1 items, and therefore follow the same rules when folding.
In the case of lists, 'Fold', when applied to a binary operator, a starting value(typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:
type | S | Aggregate state type |
param | state | Initial state |
param | RightAsync | Folder function, applied if structure is in a Right state |
returns | The aggregate state |
method Task<S> bifold <L, R, S> (EitherAsync<L, R> either, S state, Func<S, R, S> Right, Func<S, L, S> Left) Source #
Either types are like lists of 0 or 1 items, and therefore follow the same rules when folding.
In the case of lists, 'Fold', when applied to a binary operator, a starting value(typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:
type | S | Aggregate state type |
param | state | Initial state |
param | Right | Folder function, applied if Either is in a Right state |
param | Left | Folder function, applied if Either is in a Left state |
returns | The aggregate state |
method Task<S> bifoldAsync <L, R, S> (EitherAsync<L, R> either, S state, Func<S, R, Task<S>> RightAsync, Func<S, L, S> Left) Source #
Either types are like lists of 0 or 1 items, and therefore follow the same rules when folding.
In the case of lists, 'Fold', when applied to a binary operator, a starting value(typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:
type | S | Aggregate state type |
param | state | Initial state |
param | Right | Folder function, applied if Either is in a Right state |
param | Left | Folder function, applied if Either is in a Left state |
returns | The aggregate state |
method Task<S> bifoldAsync <L, R, S> (EitherAsync<L, R> either, S state, Func<S, R, S> Right, Func<S, L, Task<S>> LeftAsync) Source #
Either types are like lists of 0 or 1 items, and therefore follow the same rules when folding.
In the case of lists, 'Fold', when applied to a binary operator, a starting value(typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:
type | S | Aggregate state type |
param | state | Initial state |
param | Right | Folder function, applied if Either is in a Right state |
param | Left | Folder function, applied if Either is in a Left state |
returns | The aggregate state |
method Task<S> bifoldAsync <L, R, S> (EitherAsync<L, R> either, S state, Func<S, R, Task<S>> RightAsync, Func<S, L, Task<S>> LeftAsync) Source #
Either types are like lists of 0 or 1 items, and therefore follow the same rules when folding.
In the case of lists, 'Fold', when applied to a binary operator, a starting value(typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:
type | S | Aggregate state type |
param | state | Initial state |
param | Right | Folder function, applied if Either is in a Right state |
param | Left | Folder function, applied if Either is in a Left state |
returns | The aggregate state |
method Task<bool> forall <L, R> (EitherAsync<L, R> either, Func<R, bool> pred) Source #
Invokes a predicate on the value of the Either if it's in the Right state
type | L | Left |
type | R | Right |
param | either | Either to forall |
param | pred | Predicate |
returns | True if the Either is in a Left state. True if the Either is in a Right state and the predicate returns True. False otherwise. |
method Task<bool> forallAsync <L, R> (EitherAsync<L, R> either, Func<R, Task<bool>> pred) Source #
Invokes a predicate on the value of the Either if it's in the Right state
type | L | Left |
type | R | Right |
param | either | Either to forall |
param | pred | Predicate |
returns | True if the Either is in a Left state. True if the Either is in a Right state and the predicate returns True. False otherwise. |
method Task<bool> biforall <L, R> (EitherAsync<L, R> either, Func<R, bool> Right, Func<L, bool> Left) Source #
Invokes a predicate on the value of the Either if it's in the Right state
type | L | Left |
type | R | Right |
param | self | Either to forall |
param | Right | Right predicate |
param | Left | Left predicate |
returns | True if the predicate returns True. True if the Either is in a bottom state. |
method Task<bool> biforallAsync <L, R> (EitherAsync<L, R> either, Func<R, Task<bool>> RightAsync, Func<L, bool> Left) Source #
Invokes a predicate on the value of the Either if it's in the Right state
type | L | Left |
type | R | Right |
param | self | Either to forall |
param | Right | Right predicate |
param | Left | Left predicate |
returns | True if the predicate returns True. True if the Either is in a bottom state. |
method Task<bool> biforallAsync <L, R> (EitherAsync<L, R> either, Func<R, bool> Right, Func<L, Task<bool>> LeftAsync) Source #
Invokes a predicate on the value of the Either if it's in the Right state
type | L | Left |
type | R | Right |
param | self | Either to forall |
param | Right | Right predicate |
param | Left | Left predicate |
returns | True if the predicate returns True. True if the Either is in a bottom state. |
method Task<bool> biforallAsync <L, R> (EitherAsync<L, R> either, Func<R, Task<bool>> RightAsync, Func<L, Task<bool>> LeftAsync) Source #
Invokes a predicate on the value of the Either if it's in the Right state
type | L | Left |
type | R | Right |
param | self | Either to forall |
param | Right | Right predicate |
param | Left | Left predicate |
returns | True if the predicate returns True. True if the Either is in a bottom state. |
method Task<int> count <L, R> (EitherAsync<L, R> either) Source #
Counts the Either
type | L | Left |
type | R | Right |
param | either | Either to count |
returns | 1 if the Either is in a Right state, 0 otherwise. |
method Task<bool> exists <L, R> (EitherAsync<L, R> either, Func<R, bool> pred) Source #
Invokes a predicate on the value of the Either if it's in the Right state
type | L | Left |
type | R | Right |
param | either | Either to check existence of |
param | pred | Predicate |
returns | True if the Either is in a Right state and the predicate returns True. False otherwise. |
method Task<bool> existsAsync <L, R> (EitherAsync<L, R> either, Func<R, Task<bool>> pred) Source #
Invokes a predicate on the value of the Either if it's in the Right state
type | L | Left |
type | R | Right |
param | either | Either to check existence of |
param | pred | Predicate |
returns | True if the Either is in a Right state and the predicate returns True. False otherwise. |
method Task<bool> biexists <L, R> (EitherAsync<L, R> either, Func<R, bool> Right, Func<L, bool> Left) Source #
Invokes a predicate on the value of the Either
type | L | Left |
type | R | Right |
param | self | Either to check existence of |
param | Right | Right predicate |
param | Left | Left predicate |
returns | True if the predicate returns True. False otherwise or if the Either is in a bottom state. |
method Task<bool> biexistsAsync <L, R> (EitherAsync<L, R> either, Func<R, Task<bool>> RightAsync, Func<L, bool> Left) Source #
Invokes a predicate on the value of the Either
type | L | Left |
type | R | Right |
param | self | Either to check existence of |
param | Right | Right predicate |
param | Left | Left predicate |
returns | True if the predicate returns True. False otherwise or if the Either is in a bottom state. |
method Task<bool> biexistsAsync <L, R> (EitherAsync<L, R> either, Func<R, bool> Right, Func<L, Task<bool>> LeftAsync) Source #
Invokes a predicate on the value of the Either
type | L | Left |
type | R | Right |
param | self | Either to check existence of |
param | Right | Right predicate |
param | Left | Left predicate |
returns | True if the predicate returns True. False otherwise or if the Either is in a bottom state. |
method Task<bool> biexistsAsync <L, R> (EitherAsync<L, R> either, Func<R, Task<bool>> RightAsync, Func<L, Task<bool>> LeftAsync) Source #
Invokes a predicate on the value of the Either
type | L | Left |
type | R | Right |
param | self | Either to check existence of |
param | Right | Right predicate |
param | Left | Left predicate |
returns | True if the predicate returns True. False otherwise or if the Either is in a bottom state. |
method EitherAsync<L, Ret> map <L, R, Ret> (EitherAsync<L, R> either, Func<R, Ret> f) Source #
Maps the value in the Either if it's in a Right state
type | L | Left |
type | R | Right |
type | Ret | Mapped Either type |
param | either | Either to map |
param | f | Map function |
returns | Mapped EitherAsync |
method EitherAsync<L, Ret> mapAsync <L, R, Ret> (EitherAsync<L, R> either, Func<R, Task<Ret>> f) Source #
Maps the value in the Either if it's in a Right state
type | L | Left |
type | R | Right |
type | Ret | Mapped Either type |
param | either | Either to map |
param | f | Map function |
returns | Mapped EitherAsync |
method EitherAsync<LRet, RRet> bimap <L, R, LRet, RRet> (EitherAsync<L, R> either, Func<R, RRet> Right, Func<L, LRet> Left) Source #
Bi-maps the value in the Either if it's in a Right state
type | L | Left |
type | R | Right |
type | LRet | Left return |
type | RRet | Right return |
param | self | Either to map |
param | Right | Right map function |
param | Left | Left map function |
returns | Mapped EitherAsync |
method EitherAsync<LRet, RRet> bimapAsync <L, R, LRet, RRet> (EitherAsync<L, R> either, Func<R, Task<RRet>> RightAsync, Func<L, LRet> Left) Source #
Bi-maps the value in the Either if it's in a Right state
type | L | Left |
type | R | Right |
type | LRet | Left return |
type | RRet | Right return |
param | self | Either to map |
param | Right | Right map function |
param | Left | Left map function |
returns | Mapped EitherAsync |
method EitherAsync<LRet, RRet> bimapAsync <L, R, LRet, RRet> (EitherAsync<L, R> either, Func<R, RRet> Right, Func<L, Task<LRet>> LeftAsync) Source #
Bi-maps the value in the Either if it's in a Right state
type | L | Left |
type | R | Right |
type | LRet | Left return |
type | RRet | Right return |
param | self | Either to map |
param | Right | Right map function |
param | Left | Left map function |
returns | Mapped EitherAsync |
method EitherAsync<LRet, RRet> bimapAsync <L, R, LRet, RRet> (EitherAsync<L, R> either, Func<R, Task<RRet>> RightAsync, Func<L, Task<LRet>> LeftAsync) Source #
Bi-maps the value in the Either if it's in a Right state
type | L | Left |
type | R | Right |
type | LRet | Left return |
type | RRet | Right return |
param | self | Either to map |
param | Right | Right map function |
param | Left | Left map function |
returns | Mapped EitherAsync |
method EitherAsync<L, Func<T2, R>> parmap <L, T1, T2, R> (EitherAsync<L, T1> either, Func<T1, T2, R> func) Source #
Partial application map
method EitherAsync<L, Func<T2, Func<T3, R>>> parmap <L, T1, T2, T3, R> (EitherAsync<L, T1> either, Func<T1, T2, T3, R> func) Source #
Partial application map
method EitherAsync<L, R> filter <L, R> (EitherAsync<L, R> either, Func<R, bool> pred) Source #
Filter the Either
This may give unpredictable results for a filtered value. The Either won't return true for IsLeft or IsRight. IsBottom is True if the value is filtered and that should be checked for.
type | L | Left |
type | R | Right |
param | self | Either to filter |
param | pred | Predicate function |
returns | If the Either is in the Left state it is returned as-is. If in the Right state the predicate is applied to the Right value. If the predicate returns True the Either is returned as-is. If the predicate returns False the Either is returned in a 'Bottom' state. |
method EitherAsync<L, R> filterAsync <L, R> (EitherAsync<L, R> either, Func<R, Task<bool>> pred) Source #
Filter the Either
This may give unpredictable results for a filtered value. The Either won't return true for IsLeft or IsRight. IsBottom is True if the value is filtered and that should be checked for.
type | L | Left |
type | R | Right |
param | self | Either to filter |
param | pred | Predicate function |
returns | If the Either is in the Left state it is returned as-is. If in the Right state the predicate is applied to the Right value. If the predicate returns True the Either is returned as-is. If the predicate returns False the Either is returned in a 'Bottom' state. |
method EitherAsync<L, Ret> bind <L, R, Ret> (EitherAsync<L, R> either, Func<R, EitherAsync<L, Ret>> binder) Source #
Monadic bind function https://en.wikipedia.org/wiki/Monad_(functional_programming)
type | L | Left |
type | R | Right |
type | Ret | |
param | either | |
param | binder | |
returns | Bound EitherAsync |
method Task<IEnumerable<Ret>> match <L, R, Ret> (IEnumerable<EitherAsync<L, R>> list, Func<R, Ret> Right, Func<L, Ret> Left) Source #
Match over a sequence of EitherAsyncs
type | L | Left |
type | R | Right |
type | Ret | Mapped type |
param | list | Sequence to match over |
param | Right | Right match function |
param | Left | Left match function |
returns | Sequence of mapped values |
method Task<Lst<R>> rightToList <L, R> (EitherAsync<L, R> either) Source #
Project the Either into a Lst R
type | L | Left |
type | R | Right |
param | either | Either to project |
returns | If the Either is in a Right state, a Lst of R with one item. A zero length Lst R otherwise |
method Task<Arr<R>> rightToArray <L, R> (EitherAsync<L, R> either) Source #
Project the Either into an ImmutableArray R
type | L | Left |
type | R | Right |
param | either | Either to project |
returns | If the Either is in a Right state, a ImmutableArray of R with one item. A zero length ImmutableArray of R otherwise |
method Task<Lst<L>> leftToList <L, R> (EitherAsync<L, R> either) Source #
Project the Either into a Lst L
type | L | Left |
type | R | Right |
param | either | Either to project |
returns | If the Either is in a Left state, a Lst of L with one item. A zero length Lst L otherwise |
method Task<Arr<L>> leftToArray <L, R> (EitherAsync<L, R> either) Source #
Project the Either into an array of L
type | L | Left |
type | R | Right |
param | either | Either to project |
returns | If the Either is in a Right state, an array of L with one item. A zero length array of L otherwise |
method Task<IQueryable<R>> rightToQuery <L, R> (EitherAsync<L, R> either) Source #
Project the Either into an IQueryable of R
type | L | Left |
type | R | Right |
param | either | Either to project |
returns | If the Either is in a Right state, an IQueryable of R with one item. A zero length IQueryable R otherwise |
method Task<IQueryable<L>> leftToQuery <L, R> (EitherAsync<L, R> either) Source #
Project the Either into an IQueryable of L
type | L | Left |
type | R | Right |
param | either | Either to project |
returns | If the Either is in a Left state, an IQueryable of L with one item. A zero length IQueryable L otherwise |
method Task<IEnumerable<L>> lefts <L, R> (IEnumerable<EitherAsync<L, R>> self) Source #
Extracts from a list of 'Either' all the 'Left' elements. All the 'Left' elements are extracted in order.
type | L | Left |
type | R | Right |
param | self | Either list |
returns | An enumerable of L |
method Task<Seq<L>> lefts <L, R> (Seq<EitherAsync<L, R>> self) Source #
Extracts from a list of 'Either' all the 'Left' elements. All the 'Left' elements are extracted in order.
type | L | Left |
type | R | Right |
param | self | Either list |
returns | An enumerable of L |
method Task<IEnumerable<R>> rights <L, R> (IEnumerable<EitherAsync<L, R>> self) Source #
Extracts from a list of 'Either' all the 'Right' elements. All the 'Right' elements are extracted in order.
type | L | Left |
type | R | Right |
param | self | Either list |
returns | An enumerable of L |
method Task<Seq<R>> rights <L, R> (Seq<EitherAsync<L, R>> self) Source #
Extracts from a list of 'Either' all the 'Right' elements. All the 'Right' elements are extracted in order.
type | L | Left |
type | R | Right |
param | self | Either list |
returns | An enumerable of L |
method Task<(IEnumerable<L> Lefts, IEnumerable<R> Rights)> partition <L, R> (IEnumerable<EitherAsync<L, R>> self) Source #
Partitions a list of 'Either' into two lists. All the 'Left' elements are extracted, in order, to the first component of the output. Similarly the 'Right' elements are extracted to the second component of the output.
type | L | Left |
type | R | Right |
param | self | Either list |
returns | A tuple containing the an enumerable of L and an enumerable of R |
method Task<(Seq<L> Lefts, Seq<R> Rights)> partition <L, R> (Seq<EitherAsync<L, R>> self) Source #
Partitions a list of 'Either' into two lists. All the 'Left' elements are extracted, in order, to the first component of the output. Similarly the 'Right' elements are extracted to the second component of the output.
type | L | Left |
type | R | Right |
param | self | Either list |
returns | A tuple containing the an enumerable of L and an enumerable of R |