- Option <A>
- None = default
- Some (A value)
- Option (IEnumerable<A> option)
- GetObjectData (SerializationInfo info, StreamingContext context)
- Case
- Equals (Option<A> other)
- Equals <EqA> (Option<A> other)
- CompareTo (Option<A> other)
- CompareTo <OrdA> (Option<A> other)
- < (Option<A> lhs, Option<A> rhs)
- <= (Option<A> lhs, Option<A> rhs)
- > (Option<A> lhs, Option<A> rhs)
- >= (Option<A> lhs, Option<A> rhs)
- == (Option<A> lhs, Option<A> rhs)
- != (Option<A> lhs, Option<A> rhs)
- | (Option<A> lhs, Option<A> rhs)
- true (Option<A> value)
- false (Option<A> value)
- Equals (object? obj)
- GetHashCode ()
- CompareTo (object? obj)
- ToString ()
- IsSome
- IsNone
- Do (Action<A> f)
- Select <B> (Func<A, B> f)
- Map <B> (Func<A, B> f)
- Bind <B> (Func<A, Option<B>> f)
- BiBind <B> (Func<A, Option<B>> Some, Func<Option<B>> None)
- SelectMany <B, C> ( Func<A, Option<B>> bind, Func<A, B, C> project)
- MatchUntyped <R> (Func<object, R> Some, Func<R> None)
- MatchUntypedUnsafe <R> (Func<object, R?> Some, Func<R?> None)
- GetUnderlyingType ()
- ToArray ()
- ToList ()
- ToSeq ()
- AsEnumerable ()
- ToValidation <FAIL> (FAIL defaultFailureValue)
- ToEff ()
- ToEff (Error Fail)
- ToAff ()
- ToAff (Error Fail)
- ToFin ()
- ToFin (Error Fail)
- ToEither <L> (L defaultLeftValue)
- ToEither <L> (Func<L> Left)
- ToEitherUnsafe <L> (L? defaultLeftValue)
- ToEitherUnsafe <L> (Func<L?> Left)
- ToOptionUnsafe ()
- ToTryOption ()
- Some (Action<A> f)
- Some <B> (Func<A, B> f)
- Match <B> (Func<A, B> Some, Func<B> None)
- Match <B> (Func<A, B> Some, B None)
- MatchUnsafe <B> (Func<A, B?> Some, Func<B?> None)
- MatchUnsafe <B> (Func<A, B?> Some, B? None)
- Match (Action<A> Some, Action None)
- IfSome (Action<A> f)
- IfSome (Func<A, Unit> f)
- IfNone (Func<A> None)
- IfNone (Action None)
- IfNone (A noneValue)
- IfNoneUnsafe (Func<A?> None)
- IfNoneUnsafe (A? noneValue)
- Fold <S> (S state, Func<S, A, S> folder)
- FoldBack <S> (S state, Func<S, A, S> folder)
- BiFold <S> (S state, Func<S, A, S> Some, Func<S, Unit, S> None)
- BiFold <S> (S state, Func<S, A, S> Some, Func<S, S> None)
- BiMap <B> (Func<A, B> Some, Func<Unit, B> None)
- BiMap <B> (Func<A, B> Some, Func<B> None)
- Count ()
- ForAll (Func<A, bool> pred)
- BiForAll (Func<A, bool> Some, Func<Unit, bool> None)
- BiForAll (Func<A, bool> Some, Func<bool> None)
- Exists (Func<A, bool> pred)
- BiExists (Func<A, bool> Some, Func<Unit, bool> None)
- BiExists (Func<A, bool> Some, Func<bool> None)
- Iter (Action<A> Some)
- BiIter (Action<A> Some, Action<Unit> None)
- BiIter (Action<A> Some, Action None)
- Filter (Func<A, bool> pred)
- Where (Func<A, bool> pred)
- Join <B, C, D> ( Option<B> inner, Func<A, C> outerKeyMap, Func<B, C> innerKeyMap, Func<A, B, D> project)
- ParMap <B, C> (Func<A, B, C> func)
- ParMap <B, C, D> (Func<A, B, C, D> func)
- GetEnumerator ()
- OptionAsyncExtensions
- ToAsync <A> (this Option<A> self)
- MapAsync <A, B> (this Option<A> self, Func<A, B> f)
- MapAsync <A, B> (this Option<A> self, Func<A, Task<B>> f)
- BindAsync <A, B> (this Option<A> self, Func<A, OptionAsync<B>> f)
- BindAsync <A, B> (this Option<A> self, Func<A, Task<OptionAsync<B>>> f)
- MatchUntypedAsync <A, R> (this Option<A> self, Func<object, R> Some, Func<R> None)
- MatchUntypedAsync <A, R> (this Option<A> self, Func<object, Task<R>> Some, Func<R> None)
- MatchUntypedAsync <A, R> (this Option<A> self, Func<object, R> Some, Func<Task<R>> None)
- MatchUntypedAsync <A, R> (this Option<A> self, Func<object, Task<R>> Some, Func<Task<R>> None)
- ToArrayAsync <A> (this Option<A> self)
- ToListAsync <A> (this Option<A> self)
- ToSeqAsync <A> (this Option<A> self)
- AsEnumerableAsync <A> (this Option<A> self)
- ToEitherAsync <L, A> (this Option<A> self, L defaultLeftValue)
- ToEitherAsync <L, A> (this Option<A> self, Func<L> Left)
- ToEitherUnsafeAsync <L, A> (this Option<A> self, L? defaultLeftValue)
- ToEitherUnsafeAsync <L, A> (this Option<A> self, Func<L?> Left)
- ToOptionUnsafeAsync <A> (this Option<A> self)
- ToTryOptionAsync <A> (this Option<A> self)
- ToTryAsync <A> (this Option<A> self)
- MatchAsync <A, B> (this Option<A> self, Func<A, Task<B>> Some, Func<B> None)
- MatchAsync <A, B> (this Option<A> self, Func<A, B> Some, Func<Task<B>> None)
- MatchAsync <A, B> (this Option<A> self, Func<A, Task<B>> Some, Func<Task<B>> None)
- MatchUnsafeAsync <A, B> (this Option<A> self, Func<A, Task<B?>> Some, Func<B?> None)
- MatchUnsafeAsync <A, B> (this Option<A> self, Func<A, B?> Some, Func<Task<B?>> None)
- MatchUnsafeAsync <A, B> (this Option<A> self, Func<A, Task<B?>> Some, Func<Task<B?>> None)
- IfSomeAsync <A> (this Option<A> self, Action<A> f)
- IfSomeAsync <A> (this Option<A> self, Func<A, Task<Unit>> f)
- IfSomeAsync <A> (this Option<A> self, Func<A, Task> f)
- IfSomeAsync <A> (this Option<A> self, Func<A, Unit> f)
- IfNoneAsync <A> (this Option<A> self, Func<A> None)
- IfNoneAsync <A> (this Option<A> self, Func<Task<A>> None)
- IfNoneAsync <A> (this Option<A> self, A noneValue)
- IfNoneUnsafeAsync <A> (this Option<A> self, Func<A?> None)
- IfNoneUnsafeAsync <A> (this Option<A> self, Func<Task<A?>> None)
- IfNoneUnsafeAsync <A> (this Option<A> self, A? noneValue)
- FoldAsync <S, A> (this Option<A> self, S state, Func<S, A, S> folder)
- FoldAsync <S, A> (this Option<A> self, S state, Func<S, A, Task<S>> folder)
- FoldBackAsync <S, A> (this Option<A> self, S state, Func<S, A, S> folder)
- FoldBackAsync <S, A> (this Option<A> self, S state, Func<S, A, Task<S>> folder)
- BiFoldAsync <S, A> (this Option<A> self, S state, Func<S, A, S> Some, Func<S, Unit, S> None)
- BiFoldAsync <S, A> (this Option<A> self, S state, Func<S, A, Task<S>> Some, Func<S, Unit, S> None)
- BiFoldAsync <S, A> (this Option<A> self, S state, Func<S, A, S> Some, Func<S, Unit, Task<S>> None)
- BiFoldAsync <S, A> (this Option<A> self, S state, Func<S, A, Task<S>> Some, Func<S, Unit, Task<S>> None)
- BiFoldAsync <S, A> (this Option<A> self, S state, Func<S, A, S> Some, Func<S, S> None)
- BiFoldAsync <S, A> (this Option<A> self, S state, Func<S, A, Task<S>> Some, Func<S, S> None)
- BiFoldAsync <S, A> (this Option<A> self, S state, Func<S, A, S> Some, Func<S, Task<S>> None)
- BiFoldAsync <S, A> (this Option<A> self, S state, Func<S, A, Task<S>> Some, Func<S, Task<S>> None)
- BiMapAsync <A, B> (this Option<A> self, Func<A, B> Some, Func<Unit, B> None)
- BiMapAsync <A, B> (this Option<A> self, Func<A, B> Some, Func<B> None)
- CountAsync <A> (this Option<A> self)
- ForAllAsync <A> (this Option<A> self, Func<A, bool> pred)
- BiForAllAsync <A> (this Option<A> self, Func<A, bool> Some, Func<Unit, bool> None)
- BiForAllAsync <A> (this Option<A> self, Func<A, bool> Some, Func<bool> None)
- ExistsAsync <A> (this Option<A> self, Func<A, bool> pred)
- BiExistsAsync <A> (this Option<A> self, Func<A, bool> Some, Func<Unit, bool> None)
- BiExistsAsync <A> (this Option<A> self, Func<A, bool> Some, Func<bool> None)
- IterAsync <A> (this Option<A> self, Action<A> Some)
- IterAsync <A> (this Option<A> self, Func<A, Task<Unit>> Some)
- BiIterAsync <A> (this Option<A> self, Action<A> Some, Action<Unit> None)
- BiIterAsync <A> (this Option<A> self, Action<A> Some, Action None)
- FilterAsync <A> (this Option<A> self, Func<A, bool> pred)
- FilterAsync <A> (this Option<A> self, Func<A, Task<bool>> pred)
- AddAsync <NUM, A> (this Option<A> x, Option<A> y)
- SubtractAsync <NUM, A> (this Option<A> x, Option<A> y)
- ProductAsync <NUM, A> (this Option<A> x, Option<A> y)
- DivideAsync <NUM, A> (this Option<A> x, Option<A> y)
- ApplyAsync <A, B> (this Option<Func<A, B>> fab, Option<A> fa)
- ApplyAsync <A, B> (this Func<A, B> fab, Option<A> fa)
- ApplyAsync <A, B, C> (this Option<Func<A, B, C>> fabc, Option<A> fa, Option<B> fb)
- ApplyAsync <A, B, C> (this Func<A, B, C> fabc, Option<A> fa, Option<B> fb)
- ApplyAsync <A, B, C> (this Option<Func<A, B, C>> fabc, Option<A> fa)
- ApplyAsync <A, B, C> (this Func<A, B, C> fabc, Option<A> fa)
- ApplyAsync <A, B, C> (this Option<Func<A, Func<B, C>>> fabc, Option<A> fa)
- ApplyAsync <A, B, C> (this Func<A, Func<B, C>> fabc, Option<A> fa)
- ActionAsync <A, B> (this Option<A> fa, Option<B> fb)
- OptionExtensions
- Flatten <A> (this Option<Option<A>> ma)
- Somes <A> (this IEnumerable<Option<A>> self)
- Somes <A> (this Seq<Option<A>> self)
- Add <ARITH, A> (this Option<A> x, Option<A> y)
- Subtract <ARITH, A> (this Option<A> x, Option<A> y)
- Product <ARITH, A> (this Option<A> x, Option<A> y)
- Divide <NUM, A> (this Option<A> x, Option<A> y)
- Apply <A, B> (this Option<Func<A, B>> fab, Option<A> fa)
- Apply <A, B> (this Func<A, B> fab, Option<A> fa)
- Apply <A, B, C> (this Option<Func<A, B, C>> fabc, Option<A> fa, Option<B> fb)
- Apply <A, B, C> (this Func<A, B, C> fabc, Option<A> fa, Option<B> fb)
- Apply <A, B, C> (this Option<Func<A, B, C>> fabc, Option<A> fa)
- Apply <A, B, C> (this Func<A, B, C> fabc, Option<A> fa)
- Apply <A, B, C> (this Option<Func<A, Func<B, C>>> fabc, Option<A> fa)
- Apply <A, B, C> (this Func<A, Func<B, C>> fabc, Option<A> fa)
- Action <A, B> (this Option<A> fa, Option<B> fb)
- ToNullable <A> (this Option<A> ma)
- Match <R> (this Option<bool> ma, Func<R> True, Func<R> False, Func<R> None)
- Match <T, R> (this IEnumerable<Option<T>> list, Func<T, IEnumerable<R>> Some, Func<IEnumerable<R>> None )
- Match <T, R> (this IEnumerable<Option<T>> list, Func<T, IEnumerable<R>> Some, IEnumerable<R> None)
- Sum (this Option<int> a)
- Sum <NUM, A> (this Option<A> self)
- Prelude
- flatten <A> (Option<Option<A>> ma)
- subtract <NUM, T> (Option<T> lhs, Option<T> rhs)
- product <NUM, T> (Option<T> lhs, Option<T> rhs)
- divide <NUM, T> (Option<T> lhs, Option<T> rhs)
- add <NUM, T> (Option<T> lhs, Option<T> rhs)
- isSome <T> (Option<T> value)
- isNone <T> (Option<T> value)
- None
- Some <A> (A value)
- Some <A> (A? value)
- Optional <A> (A? value)
- Optional <A> (A? value)
- ifSome <T> (Option<T> option, Action<T> Some)
- ifNone <T> (Option<T> option, Func<T> None)
- ifNone <T> (Option<T> option, T noneValue)
- ifNoneUnsafe <T> (Option<T> option, Func<T?> None)
- ifNoneUnsafe <T> (Option<T> option, T? noneValue)
- match <T, R> (Option<T> option, Func<T, R> Some, Func<R> None)
- matchUnsafe <T, R> (Option<T> option, Func<T, R?> Some, Func<R?> None)
- match <T> (Option<T> option, Action<T> Some, Action None)
- apply <A, B> (Option<Func<A, B>> fab, Option<A> fa)
- apply <A, B> (Func<A, B> fab, Option<A> fa)
- apply <A, B, C> (Option<Func<A, B, C>> fabc, Option<A> fa, Option<B> fb)
- apply <A, B, C> (Func<A, B, C> fabc, Option<A> fa, Option<B> fb)
- apply <A, B, C> (Option<Func<A, B, C>> fabc, Option<A> fa)
- apply <A, B, C> (Func<A, B, C> fabc, Option<A> fa)
- apply <A, B, C> (Option<Func<A, Func<B, C>>> fabc, Option<A> fa)
- apply <A, B, C> (Func<A, Func<B, C>> fabc, Option<A> fa)
- action <A, B> (Option<A> fa, Option<B> fb)
- fold <S, A> (Option<A> option, S state, Func<S, A, S> folder)
- bifold <S, A> (Option<A> option, S state, Func<S, A, S> Some, Func<S, S> None)
- bifold <S, A> (Option<A> option, S state, Func<S, A, S> Some, Func<S, Unit, S> None)
- forall <A> (Option<A> option, Func<A, bool> pred)
- biforall <A> (Option<A> option, Func<A, bool> Some, Func<Unit, bool> None)
- biforall <A> (Option<A> option, Func<A, bool> Some, Func<bool> None)
- count <A> (Option<A> option)
- exists <A> (Option<A> option, Func<A, bool> pred)
- biexists <A> (Option<A> option, Func<A, bool> Some, Func<Unit, bool> None)
- biexists <A> (Option<A> option, Func<A, bool> Some, Func<bool> None)
- map <A, B> (Option<A> option, Func<A, B> f)
- bimap <A, B> (Option<A> option, Func<A, B> Some, Func<B> None)
- bimap <A, B> (Option<A> option, Func<A, B> Some, Func<Unit, B> None)
- parmap <T1, T2, R> (Option<T1> option, Func<T1, T2, R> mapper)
- parmap <T1, T2, T3, R> (Option<T1> option, Func<T1, T2, T3, R> mapper)
- filter <T> (Option<T> option, Func<T, bool> pred)
- bind <T, R> (Option<T> option, Func<T, Option<R>> binder)
- match <T, R> (IEnumerable<Option<T>> list, Func<T, IEnumerable<R>> Some, Func<IEnumerable<R>> None )
- match <T, R> (IEnumerable<Option<T>> list, Func<T, IEnumerable<R>> Some, IEnumerable<R> None)
- somes <T> (IEnumerable<Option<T>> list)
- toList <T> (Option<T> option)
- toArray <T> (Option<T> option)
- TaskOptionAsyncExtensions
- ToAsync <A> (this Task<Option<A>> ma)
- MapAsync <A, B> (this Task<Option<A>> self, Func<A, B> f)
- MapAsync <A, B> (this Task<Option<A>> self, Func<A, Task<B>> f)
- BindAsync <A, B> (this Task<Option<A>> self, Func<A, Option<B>> f)
- BindAsync <A, B> (this Task<Option<A>> self, Func<A, Task<Option<B>>> f)
- BindAsync <A, B> (this Task<Option<A>> self, Func<A, OptionAsync<B>> f)
- BindAsync <A, B> (this Task<Option<A>> self, Func<A, Task<OptionAsync<B>>> f)
- MatchUntypedAsync <A, R> (this Task<Option<A>> self, Func<object, R> Some, Func<R> None)
- MatchUntypedAsync <A, R> (this Task<Option<A>> self, Func<object, Task<R>> Some, Func<R> None)
- MatchUntypedAsync <A, R> (this Task<Option<A>> self, Func<object, R> Some, Func<Task<R>> None)
- MatchUntypedAsync <A, R> (this Task<Option<A>> self, Func<object, Task<R>> Some, Func<Task<R>> None)
- ToArrayAsync <A> (this Task<Option<A>> self)
- ToListAsync <A> (this Task<Option<A>> self)
- ToSeqAsync <A> (this Task<Option<A>> self)
- AsEnumerableAsync <A> (this Task<Option<A>> self)
- ToEitherAsync <L, A> (this Task<Option<A>> self, L defaultLeftValue)
- ToEitherAsync <L, A> (this Task<Option<A>> self, Func<L> Left)
- ToEitherUnsafeAsync <L, A> (this Task<Option<A>> self, L? defaultLeftValue)
- ToEitherUnsafeAsync <L, A> (this Task<Option<A>> self, Func<L?> Left)
- ToOptionUnsafeAsync <A> (this Task<Option<A>> self)
- ToTryOptionAsync <A> (this Task<Option<A>> self)
- ToTryAsync <A> (this Task<Option<A>> self)
- Match <A, B> (this Task<Option<A>> self, Func<A, B> Some, Func<B> None)
- MatchAsync <A, B> (this Task<Option<A>> self, Func<A, Task<B>> Some, Func<B> None)
- MatchAsync <A, B> (this Task<Option<A>> self, Func<A, B> Some, Func<Task<B>> None)
- MatchAsync <A, B> (this Task<Option<A>> self, Func<A, Task<B>> Some, Func<Task<B>> None)
- MatchUnsafe <A, B> (this Task<Option<A>> self, Func<A, B?> Some, Func<B?> None)
- MatchUnsafeAsync <A, B> (this Task<Option<A>> self, Func<A, Task<B?>> Some, Func<B?> None)
- MatchUnsafeAsync <A, B> (this Task<Option<A>> self, Func<A, B?> Some, Func<Task<B?>> None)
- MatchUnsafeAsync <A, B> (this Task<Option<A>> self, Func<A, Task<B?>> Some, Func<Task<B?>> None)
- Match <A> (this Task<Option<A>> self, Action<A> Some, Action None)
- IfSomeAsync <A> (this Task<Option<A>> self, Action<A> f)
- IfSomeAsync <A> (this Task<Option<A>> self, Func<A, Task<Unit>> f)
- IfSomeAsync <A> (this Task<Option<A>> self, Func<A, Task> f)
- IfSomeAsync <A> (this Task<Option<A>> self, Func<A, Unit> f)
- IfNoneAsync <A> (this Task<Option<A>> self, Func<A> None)
- IfNoneAsync <A> (this Task<Option<A>> self, Func<Task<A>> None)
- IfNoneAsync <A> (this Task<Option<A>> self, A noneValue)
- IfNoneUnsafeAsync <A> (this Task<Option<A>> self, Func<A?> None)
- IfNoneUnsafeAsync <A> (this Task<Option<A>> self, Func<Task<A?>> None)
- IfNoneUnsafeAsync <A> (this Task<Option<A>> self, A? noneValue)
- FoldAsync <S, A> (this Task<Option<A>> self, S state, Func<S, A, S> folder)
- FoldAsync <S, A> (this Task<Option<A>> self, S state, Func<S, A, Task<S>> folder)
- FoldBackAsync <S, A> (this Task<Option<A>> self, S state, Func<S, A, S> folder)
- FoldBackAsync <S, A> (this Task<Option<A>> self, S state, Func<S, A, Task<S>> folder)
- BiFoldAsync <S, A> (this Task<Option<A>> self, S state, Func<S, A, S> Some, Func<S, Unit, S> None)
- BiFoldAsync <S, A> (this Task<Option<A>> self, S state, Func<S, A, Task<S>> Some, Func<S, Unit, S> None)
- BiFoldAsync <S, A> (this Task<Option<A>> self, S state, Func<S, A, S> Some, Func<S, Unit, Task<S>> None)
- BiFoldAsync <S, A> (this Task<Option<A>> self, S state, Func<S, A, Task<S>> Some, Func<S, Unit, Task<S>> None)
- BiFoldAsync <S, A> (this Task<Option<A>> self, S state, Func<S, A, S> Some, Func<S, S> None)
- BiFoldAsync <S, A> (this Task<Option<A>> self, S state, Func<S, A, Task<S>> Some, Func<S, S> None)
- BiFoldAsync <S, A> (this Task<Option<A>> self, S state, Func<S, A, S> Some, Func<S, Task<S>> None)
- BiFoldAsync <S, A> (this Task<Option<A>> self, S state, Func<S, A, Task<S>> Some, Func<S, Task<S>> None)
- BiMapAsync <A, B> (this Task<Option<A>> self, Func<A, B> Some, Func<Unit, B> None)
- BiMapAsync <A, B> (this Task<Option<A>> self, Func<A, Task<B>> Some, Func<Unit, B> None)
- BiMapAsync <A, B> (this Task<Option<A>> self, Func<A, Task<B>> Some, Func<Unit, Task<B>> None)
- BiMapAsync <A, B> (this Task<Option<A>> self, Func<A, B> Some, Func<Unit, Task<B>> None)
- BiMapAsync <A, B> (this Task<Option<A>> self, Func<A, B> Some, Func<B> None)
- BiMapAsync <A, B> (this Task<Option<A>> self, Func<A, Task<B>> Some, Func<B> None)
- BiMapAsync <A, B> (this Task<Option<A>> self, Func<A, Task<B>> Some, Func<Task<B>> None)
- BiMapAsync <A, B> (this Task<Option<A>> self, Func<A, B> Some, Func<Task<B>> None)
- CountAsync <A> (this Task<Option<A>> self)
- ForAllAsync <A> (this Task<Option<A>> self, Func<A, bool> pred)
- BiForAllAsync <A> (this Task<Option<A>> self, Func<A, bool> Some, Func<Unit, bool> None)
- BiForAllAsync <A> (this Task<Option<A>> self, Func<A, bool> Some, Func<bool> None)
- ExistsAsync <A> (this Task<Option<A>> self, Func<A, bool> pred)
- BiExistsAsync <A> (this Task<Option<A>> self, Func<A, bool> Some, Func<Unit, bool> None)
- BiExistsAsync <A> (this Task<Option<A>> self, Func<A, bool> Some, Func<bool> None)
- IterAsync <A> (this Task<Option<A>> self, Action<A> Some)
- IterAsync <A> (this Task<Option<A>> self, Func<A, Task<Unit>> Some)
- BiIterAsync <A> (this Task<Option<A>> self, Action<A> Some, Action<Unit> None)
- BiIterAsync <A> (this Task<Option<A>> self, Action<A> Some, Action None)
- FilterAsync <A> (this Task<Option<A>> self, Func<A, bool> pred)
- FilterAsync <A> (this Task<Option<A>> self, Func<A, Task<bool>> pred)
- AddAsync <NUM, A> (this Task<Option<A>> x, Task<Option<A>> y)
- SubtractAsync <NUM, A> (this Task<Option<A>> x, Task<Option<A>> y)
- ProductAsync <NUM, A> (this Task<Option<A>> x, Task<Option<A>> y)
- DivideAsync <NUM, A> (this Task<Option<A>> x, Task<Option<A>> y)
- ApplyAsync <A, B> (this Option<Func<A, B>> fab, Task<Option<A>> fa)
- ApplyAsync <A, B> (this Func<A, B> fab, Task<Option<A>> fa)
- ApplyAsync <A, B, C> (this Option<Func<A, B, C>> fabc, Task<Option<A>> fa, Option<B> fb)
- ApplyAsync <A, B, C> (this Func<A, B, C> fabc, Task<Option<A>> fa, Option<B> fb)
- ApplyAsync <A, B, C> (this Option<Func<A, B, C>> fabc, Task<Option<A>> fa)
- ApplyAsync <A, B, C> (this Func<A, B, C> fabc, Task<Option<A>> fa)
- ApplyAsync <A, B, C> (this Option<Func<A, Func<B, C>>> fabc, Task<Option<A>> fa)
- ApplyAsync <A, B, C> (this Func<A, Func<B, C>> fabc, Task<Option<A>> fa)
- ActionAsync <A, B> (this Task<Option<A>> fa, Option<B> fb)
Discriminated union type. Can be in one of two states:
Some(a)
None
Typeclass instances available for this type:
BiFoldable : MOption
Eq : EqOpt
Foldable : MOption
Functor : FOption
MonadPlus : MOption
Optional : MOption
Ord : OrdOpt
type | A | Bound value |
field Option<A> None = default Source #
None
method Option<A> Some (A value) Source #
Construct an Option of A in a Some state
param | value | Value to bind, must be non-null |
returns | Option of A |
method void GetObjectData (SerializationInfo info, StreamingContext context) Source #
method bool Equals (Option<A> other) Source #
Uses the EqDefault
instance to do an equality check on the bound value.
To use anything other than the default call oa.Equals<EqA>(ob)
where EqA
is an instance derived from Eq<A>
This uses the EqDefault
instance for comparison of the bound A
values.
The EqDefault
instance wraps up the .NET EqualityComparer.Default
behaviour.
param | other | The |
returns |
|
method bool Equals <EqA> (Option<A> other) Source #
Uses the EqA
instance to do an equality check on the bound value.
param | other | The |
returns |
|
method int CompareTo (Option<A> other) Source #
Uses the OrdDefault
instance to do an ordering comparison on the bound
value. To use anything other than the default call this.Compare<OrdA>(this, other)
,
where OrdA
is an instance derived from Ord<A>
param | other | The |
method int CompareTo <OrdA> (Option<A> other) Source #
Uses the Ord
instance provided to do an ordering comparison on the bound
value.
param | other | The |
method bool Equals (object? obj) Source #
DO NOT USE - Use the Structural equality variant of this method Equals<EQ, A>(y)
method int GetHashCode () Source #
Calculate the hash-code from the bound value, unless the Option is in a None state, in which case the hash-code will be 0
returns | Hash-code from the bound value, unless the Option is in a None state, in which case the hash-code will be 0 |
method string ToString () Source #
Get a string representation of the Option
returns | String representation of the Option |
method Option<A> Do (Action<A> f) Source #
Impure iteration of the bound value in the structure
returns | Returns the original unmodified structure |
method Option<B> Select <B> (Func<A, B> f) Source #
Projection from one value to another
type | B | Resulting functor value type |
param | f | Projection function |
returns | Mapped functor |
method Option<B> Map <B> (Func<A, B> f) Source #
Projection from one value to another
type | B | Resulting functor value type |
param | f | Projection function |
returns | Mapped functor |
method Option<B> BiBind <B> (Func<A, Option<B>> Some, Func<Option<B>> None) Source #
Bi-bind. Allows mapping of both monad states
method Option<C> SelectMany <B, C> ( Func<A, Option<B>> bind, Func<A, B, C> project) Source #
Monad bind operation
method R MatchUntyped <R> (Func<object, R> Some, Func<R> None) Source #
Match operation with an untyped value for Some. This can be useful for serialisation and dealing with the IOptional interface
type | R | The return type |
param | Some | Operation to perform if the option is in a Some state |
param | None | Operation to perform if the option is in a None state |
returns | The result of the match operation |
method R MatchUntypedUnsafe <R> (Func<object, R?> Some, Func<R?> None) Source #
Match operation with an untyped value for Some. This can be useful for serialisation and dealing with the IOptional interface
type | R | The return type |
param | Some | Operation to perform if the option is in a Some state |
param | None | Operation to perform if the option is in a None state |
returns | The result of the match operation |
method Type GetUnderlyingType () Source #
Get the Type of the bound value
returns | Type of the bound value |
method Arr<A> ToArray () Source #
Convert the Option to an enumerable of zero or one items
returns | An enumerable of zero or one items |
method Lst<A> ToList () Source #
Convert the Option to an immutable list of zero or one items
returns | An immutable list of zero or one items |
method Seq<A> ToSeq () Source #
Convert the Option to an enumerable sequence of zero or one items
returns | An enumerable sequence of zero or one items |
method IEnumerable<A> AsEnumerable () Source #
Convert the Option to an enumerable of zero or one items
returns | An enumerable of zero or one items |
method Validation<FAIL, A> ToValidation <FAIL> (FAIL defaultFailureValue) Source #
method Eff<A> ToEff () Source #
Convert the structure to an Eff
returns | An Eff representation of the structure |
method Eff<A> ToEff (Error Fail) Source #
Convert the structure to an Eff
param | Fail | Default value if the structure is in a None state |
returns | An Eff representation of the structure |
method Aff<A> ToAff () Source #
Convert the structure to an Aff
returns | An Aff representation of the structure |
method Aff<A> ToAff (Error Fail) Source #
Convert the structure to an Aff
param | Fail | Default value if the structure is in a None state |
returns | An Aff representation of the structure |
method Fin<A> ToFin () Source #
Convert the structure to a Fin
returns | A Fin representation of the structure |
method Fin<A> ToFin (Error Fail) Source #
Convert the structure to a Fin
param | Fail | Default value if the structure is in a None state |
returns | A Fin representation of the structure |
method Either<L, A> ToEither <L> (L defaultLeftValue) Source #
Convert the structure to an Either
param | defaultLeftValue | Default value if the structure is in a None state |
returns | An Either representation of the structure |
method Either<L, A> ToEither <L> (Func<L> Left) Source #
Convert the structure to an Either
param | Left | Function to invoke to get a default value if the structure is in a None state |
returns | An Either representation of the structure |
method EitherUnsafe<L, A> ToEitherUnsafe <L> (L? defaultLeftValue) Source #
Convert the structure to an EitherUnsafe
param | defaultLeftValue | Default value if the structure is in a None state |
returns | An EitherUnsafe representation of the structure |
method EitherUnsafe<L, A> ToEitherUnsafe <L> (Func<L?> Left) Source #
Convert the structure to an EitherUnsafe
param | Left | Function to invoke to get a default value if the structure is in a None state |
returns | An EitherUnsafe representation of the structure |
method OptionUnsafe<A> ToOptionUnsafe () Source #
Convert the structure to a OptionUnsafe
returns | An OptionUnsafe representation of the structure |
method TryOption<A> ToTryOption () Source #
Convert the structure to a TryOption
returns | A TryOption representation of the structure |
method SomeUnitContext<MOption<A>, Option<A>, A> Some (Action<A> f) Source #
Fluent pattern matching. Provide a Some handler and then follow on fluently with .None(...) to complete the matching operation. This is for dispatching actions, use Some<A,B>(...) to return a value from the match operation.
param | f | The Some(x) match operation |
method SomeContext<MOption<A>, Option<A>, A, B> Some <B> (Func<A, B> f) Source #
Fluent pattern matching. Provide a Some handler and then follow on fluently with .None(...) to complete the matching operation. This is for returning a value from the match operation, to dispatch an action instead, use Some(...)
type | B | Match operation return value type |
param | f | The Some(x) match operation |
returns | The result of the match operation |
method B Match <B> (Func<A, B> Some, Func<B> None) Source #
Match the two states of the Option and return a non-null R.
type | B | Return type |
param | Some | Some match operation. Must not return null. |
param | None | None match operation. Must not return null. |
returns | A non-null B |
method B Match <B> (Func<A, B> Some, B None) Source #
Match the two states of the Option and return a non-null R.
type | B | Return type |
param | Some | Some match operation. Must not return null. |
param | None | None match operation. Must not return null. |
returns | A non-null B |
method B? MatchUnsafe <B> (Func<A, B?> Some, Func<B?> None) Source #
Match the two states of the Option and return a B, which can be null.
type | B | Return type |
param | Some | Some match operation. May return null. |
param | None | None match operation. May return null. |
returns | B, or null |
method B? MatchUnsafe <B> (Func<A, B?> Some, B? None) Source #
Match the two states of the Option and return a B, which can be null.
type | B | Return type |
param | Some | Some match operation. May return null. |
param | None | None match operation. May return null. |
returns | B, or null |
method Unit Match (Action<A> Some, Action None) Source #
Match the two states of the Option
param | Some | Some match operation |
param | None | None match operation |
method Unit IfSome (Action<A> f) Source #
Invokes the action if Option is in the Some state, otherwise nothing happens.
param | f | Action to invoke if Option is in the Some state |
method Unit IfSome (Func<A, Unit> f) Source #
Invokes the f function if Option is in the Some state, otherwise nothing happens.
param | f | Function to invoke if Option is in the Some state |
method A IfNone (Func<A> None) Source #
Returns the result of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned.
Will not accept a null return value from the None operation
param | None | Operation to invoke if the structure is in a None state |
returns | Result of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned. |
method Unit IfNone (Action None) Source #
Invokes the action if Option is in the None state, otherwise nothing happens.
param | f | Action to invoke if Option is in the None state |
method A IfNone (A noneValue) Source #
Returns the noneValue if the optional is in a None state, otherwise the bound Some(x) value is returned.
Will not accept a null noneValue
param | noneValue | Value to return if in a None state |
returns | noneValue if the optional is in a None state, otherwise the bound Some(x) value is returned |
method A? IfNoneUnsafe (Func<A?> None) Source #
Returns the result of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned.
Will allow null the be returned from the None operation
param | None | Operation to invoke if the structure is in a None state |
returns | Result of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned. |
method A? IfNoneUnsafe (A? noneValue) Source #
Returns the noneValue if the optional is in a None state, otherwise the bound Some(x) value is returned.
Will allow noneValue to be null
param | noneValue | Value to return if in a None state |
returns | noneValue if the optional is in a None state, otherwise the bound Some(x) value is returned |
method S Fold <S> (S state, Func<S, A, S> folder) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | folder | Folder function, applied if Option is in a Some state |
returns | The aggregate state |
method S FoldBack <S> (S state, Func<S, A, S> folder) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | folder | Folder function, applied if Option is in a Some state |
returns | The aggregate state |
method S BiFold <S> (S state, Func<S, A, S> Some, Func<S, Unit, S> None) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | Some | Folder function, applied if Option is in a Some state |
param | None | Folder function, applied if Option is in a None state |
returns | The aggregate state |
method S BiFold <S> (S state, Func<S, A, S> Some, Func<S, S> None) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | Some | Folder function, applied if Option is in a Some state |
param | None | Folder function, applied if Option is in a None state |
returns | The aggregate state |
method Option<B> BiMap <B> (Func<A, B> Some, Func<Unit, B> None) Source #
Projection from one value to another
type | B | Resulting functor value type |
param | Some | Projection function |
param | None | Projection function |
returns | Mapped functor |
method Option<B> BiMap <B> (Func<A, B> Some, Func<B> None) Source #
Projection from one value to another
type | B | Resulting functor value type |
param | Some | Projection function |
param | None | Projection function |
returns | Mapped functor |
Return the number of bound values in this structure:
None = 0
Some = 1
returns |
method bool ForAll (Func<A, bool> pred) Source #
Apply a predicate to the bound value. If the Option is in a None state then True is returned (because the predicate applies for-all values). If the Option is in a Some state the value is the result of running applying the bound value to the predicate supplied.
param | pred | |
returns | If the Option is in a None state then True is returned (because the predicate applies for-all values). If the Option is in a Some state the value is the result of running applying the bound value to the predicate supplied. |
method bool BiForAll (Func<A, bool> Some, Func<Unit, bool> None) Source #
Apply a predicate to the bound value. If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied.
param | Some | Predicate to apply if in a Some state |
param | None | Predicate to apply if in a None state |
returns | If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied. |
method bool BiForAll (Func<A, bool> Some, Func<bool> None) Source #
Apply a predicate to the bound value. If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied.
param | Some | Predicate to apply if in a Some state |
param | None | Predicate to apply if in a None state |
returns | If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied. |
method bool Exists (Func<A, bool> pred) Source #
Apply a predicate to the bound value. If the Option is in a None state then False is returned. If the Option is in a Some state the value is the result of running applying the bound value to the predicate supplied.
param | pred | |
returns | If the Option is in a None state then False is returned. If the Option is in a Some state the value is the result of running applying the bound value to the predicate supplied. |
method bool BiExists (Func<A, bool> Some, Func<Unit, bool> None) Source #
Apply a predicate to the bound value. If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied.
param | pred | |
returns | If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied. |
method bool BiExists (Func<A, bool> Some, Func<bool> None) Source #
Apply a predicate to the bound value. If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied.
param | pred | |
returns | If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied. |
method Unit Iter (Action<A> Some) Source #
Invoke an action for the bound value (if in a Some state)
param | Some | Action to invoke |
method Unit BiIter (Action<A> Some, Action<Unit> None) Source #
Invoke an action depending on the state of the Option
param | Some | Action to invoke if in a Some state |
param | None | Action to invoke if in a None state |
method Unit BiIter (Action<A> Some, Action None) Source #
Invoke an action depending on the state of the Option
param | Some | Action to invoke if in a Some state |
param | None | Action to invoke if in a None state |
method Option<A> Filter (Func<A, bool> pred) Source #
Apply a predicate to the bound value (if in a Some state)
param | pred | Predicate to apply |
returns | Some(x) if the Option is in a Some state and the predicate returns True. None otherwise. |
method Option<A> Where (Func<A, bool> pred) Source #
Apply a predicate to the bound value (if in a Some state)
param | pred | Predicate to apply |
returns | Some(x) if the Option is in a Some state and the predicate returns True. None otherwise. |
method Option<D> Join <B, C, D> ( Option<B> inner, Func<A, C> outerKeyMap, Func<B, C> innerKeyMap, Func<A, B, D> project) Source #
Monadic join
method Option<Func<B, Func<C, D>>> ParMap <B, C, D> (Func<A, B, C, D> func) Source #
Partial application map
method IEnumerator<A> GetEnumerator () Source #
Get an enumerator for the Option
operator < (Option<A> lhs, Option<A> rhs) Source #
Comparison operator
param | lhs | The left hand side of the operation |
param | rhs | The right hand side of the operation |
returns | True if lhs < rhs |
operator <= (Option<A> lhs, Option<A> rhs) Source #
Comparison operator
param | lhs | The left hand side of the operation |
param | rhs | The right hand side of the operation |
returns | True if lhs <= rhs |
operator > (Option<A> lhs, Option<A> rhs) Source #
Comparison operator
param | lhs | The left hand side of the operation |
param | rhs | The right hand side of the operation |
returns | True if lhs > rhs |
operator >= (Option<A> lhs, Option<A> rhs) Source #
Comparison operator
param | lhs | The left hand side of the operation |
param | rhs | The right hand side of the operation |
returns | True if lhs >= rhs |
operator == (Option<A> lhs, Option<A> rhs) Source #
Equality operator
This uses the EqDefault instance for comparison of the bound A values. The EqDefault instance wraps up the .NET EqualityComparer.Default behaviour. For more control over equality you can call:
equals<EQ, A>(lhs, rhs);
Where EQ is a struct derived from Eq. For example:
equals<EqString, string>(lhs, rhs);
equals<EqArray<int>, int[]>(lhs, rhs);
param | lhs | Left hand side of the operation |
param | rhs | Right hand side of the operation |
returns | True if the values are equal |
operator != (Option<A> lhs, Option<A> rhs) Source #
Non-equality operator
This uses the EqDefault instance for comparison of the A value. The EqDefault type-class wraps up the .NET EqualityComparer.Default behaviour. For more control over equality you can call:
!equals<EQ, A>(lhs, rhs);
Where EQ is a struct derived from Eq. For example:
!equals<EqString, string>(lhs, rhs);
!equals<EqArray<int>, int[]>(lhs, rhs);
param | lhs | Left hand side of the operation |
param | rhs | Right hand side of the operation |
returns | True if the values are equal |
class OptionAsyncExtensions Source #
method OptionAsync<A> ToAsync <A> (this Option<A> self) Source #
Converts this Option to an OptionAsync
type | A | Bound value type |
param | self | This |
returns | Asynchronous Try |
method OptionAsync<B> MapAsync <A, B> (this Option<A> self, Func<A, B> f) Source #
Projection from one value to another
type | B | Resulting functor value type |
param | f | Projection function |
returns | Mapped functor |
method OptionAsync<B> MapAsync <A, B> (this Option<A> self, Func<A, Task<B>> f) Source #
Projection from one value to another
type | B | Resulting functor value type |
param | f | Projection function |
returns | Mapped functor |
method OptionAsync<B> BindAsync <A, B> (this Option<A> self, Func<A, OptionAsync<B>> f) Source #
Monad bind operation
method OptionAsync<B> BindAsync <A, B> (this Option<A> self, Func<A, Task<OptionAsync<B>>> f) Source #
Monad bind operation
method Task<R> MatchUntypedAsync <A, R> (this Option<A> self, Func<object, R> Some, Func<R> None) Source #
Match operation with an untyped value for Some. This can be useful for serialisation and dealing with the IOptional interface
type | R | The return type |
param | Some | Operation to perform if the option is in a Some state |
param | None | Operation to perform if the option is in a None state |
returns | The result of the match operation |
method Task<R> MatchUntypedAsync <A, R> (this Option<A> self, Func<object, Task<R>> Some, Func<R> None) Source #
Match operation with an untyped value for Some. This can be useful for serialisation and dealing with the IOptional interface
type | R | The return type |
param | Some | Operation to perform if the option is in a Some state |
param | None | Operation to perform if the option is in a None state |
returns | The result of the match operation |
method Task<R> MatchUntypedAsync <A, R> (this Option<A> self, Func<object, R> Some, Func<Task<R>> None) Source #
Match operation with an untyped value for Some. This can be useful for serialisation and dealing with the IOptional interface
type | R | The return type |
param | Some | Operation to perform if the option is in a Some state |
param | None | Operation to perform if the option is in a None state |
returns | The result of the match operation |
method Task<R> MatchUntypedAsync <A, R> (this Option<A> self, Func<object, Task<R>> Some, Func<Task<R>> None) Source #
Match operation with an untyped value for Some. This can be useful for serialisation and dealing with the IOptional interface
type | R | The return type |
param | Some | Operation to perform if the option is in a Some state |
param | None | Operation to perform if the option is in a None state |
returns | The result of the match operation |
method Task<Arr<A>> ToArrayAsync <A> (this Option<A> self) Source #
Convert the Option to an enumerable of zero or one items
returns | An enumerable of zero or one items |
method Task<Lst<A>> ToListAsync <A> (this Option<A> self) Source #
Convert the Option to an immutable list of zero or one items
returns | An immutable list of zero or one items |
method Task<Seq<A>> ToSeqAsync <A> (this Option<A> self) Source #
Convert the Option to an enumerable sequence of zero or one items
returns | An enumerable sequence of zero or one items |
method Task<IEnumerable<A>> AsEnumerableAsync <A> (this Option<A> self) Source #
Convert the Option to an enumerable of zero or one items
returns | An enumerable of zero or one items |
method EitherAsync<L, A> ToEitherAsync <L, A> (this Option<A> self, L defaultLeftValue) Source #
Convert the structure to an Either
param | defaultLeftValue | Default value if the structure is in a None state |
returns | An Either representation of the structure |
method EitherAsync<L, A> ToEitherAsync <L, A> (this Option<A> self, Func<L> Left) Source #
Convert the structure to an Either
param | defaultLeftValue | Function to invoke to get a default value if the structure is in a None state |
returns | An Either representation of the structure |
method Task<EitherUnsafe<L, A>> ToEitherUnsafeAsync <L, A> (this Option<A> self, L? defaultLeftValue) Source #
Convert the structure to an EitherUnsafe
param | defaultLeftValue | Default value if the structure is in a None state |
returns | An EitherUnsafe representation of the structure |
method Task<EitherUnsafe<L, A>> ToEitherUnsafeAsync <L, A> (this Option<A> self, Func<L?> Left) Source #
Convert the structure to an EitherUnsafe
param | defaultLeftValue | Function to invoke to get a default value if the structure is in a None state |
returns | An EitherUnsafe representation of the structure |
method Task<OptionUnsafe<A>> ToOptionUnsafeAsync <A> (this Option<A> self) Source #
Convert the structure to a OptionUnsafe
returns | An OptionUnsafe representation of the structure |
method TryOptionAsync<A> ToTryOptionAsync <A> (this Option<A> self) Source #
Convert the structure to a TryOptionAsync
returns | A TryOptionAsync representation of the structure |
method TryAsync<A> ToTryAsync <A> (this Option<A> self) Source #
Convert the structure to a TryAsync
returns | A TryAsync representation of the structure |
method Task<B> MatchAsync <A, B> (this Option<A> self, Func<A, Task<B>> Some, Func<B> None) Source #
Match the two states of the Option and return a non-null R.
type | B | Return type |
param | Some | Some match operation. Must not return null. |
param | None | None match operation. Must not return null. |
returns | A non-null B |
method Task<B> MatchAsync <A, B> (this Option<A> self, Func<A, B> Some, Func<Task<B>> None) Source #
Match the two states of the Option and return a non-null R.
type | B | Return type |
param | Some | Some match operation. Must not return null. |
param | None | None match operation. Must not return null. |
returns | A non-null B |
method Task<B> MatchAsync <A, B> (this Option<A> self, Func<A, Task<B>> Some, Func<Task<B>> None) Source #
Match the two states of the Option and return a non-null R.
type | B | Return type |
param | Some | Some match operation. Must not return null. |
param | None | None match operation. Must not return null. |
returns | A non-null B |
method Task<B?> MatchUnsafeAsync <A, B> (this Option<A> self, Func<A, Task<B?>> Some, Func<B?> None) Source #
Match the two states of the Option and return a B, which can be null.
type | B | Return type |
param | Some | Some match operation. May return null. |
param | None | None match operation. May return null. |
returns | B, or null |
method Task<B?> MatchUnsafeAsync <A, B> (this Option<A> self, Func<A, B?> Some, Func<Task<B?>> None) Source #
Match the two states of the Option and return a B, which can be null.
type | B | Return type |
param | Some | Some match operation. May return null. |
param | None | None match operation. May return null. |
returns | B, or null |
method Task<B?> MatchUnsafeAsync <A, B> (this Option<A> self, Func<A, Task<B?>> Some, Func<Task<B?>> None) Source #
Match the two states of the Option and return a B, which can be null.
type | B | Return type |
param | Some | Some match operation. May return null. |
param | None | None match operation. May return null. |
returns | B, or null |
method Task<Unit> IfSomeAsync <A> (this Option<A> self, Action<A> f) Source #
Invokes the action if Option is in the Some state, otherwise nothing happens.
param | f | Action to invoke if Option is in the Some state |
method Task<Unit> IfSomeAsync <A> (this Option<A> self, Func<A, Task<Unit>> f) Source #
Invokes the f function if Option is in the Some state, otherwise nothing happens.
param | f | Function to invoke if Option is in the Some state |
method Task<Unit> IfSomeAsync <A> (this Option<A> self, Func<A, Task> f) Source #
Invokes the f function if Option is in the Some state, otherwise nothing happens.
param | f | Function to invoke if Option is in the Some state |
method Task<Unit> IfSomeAsync <A> (this Option<A> self, Func<A, Unit> f) Source #
Invokes the f function if Option is in the Some state, otherwise nothing happens.
param | f | Function to invoke if Option is in the Some state |
method Task<A> IfNoneAsync <A> (this Option<A> self, Func<A> None) Source #
Returns the result of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned.
Will not accept a null return value from the None operation
param | None | Operation to invoke if the structure is in a None state |
returns | Tesult of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned. |
method Task<A> IfNoneAsync <A> (this Option<A> self, Func<Task<A>> None) Source #
Returns the result of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned.
Will not accept a null return value from the None operation
param | None | Operation to invoke if the structure is in a None state |
returns | Tesult of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned. |
method Task<A> IfNoneAsync <A> (this Option<A> self, A noneValue) Source #
Returns the noneValue if the optional is in a None state, otherwise the bound Some(x) value is returned.
Will not accept a null noneValue
param | noneValue | Value to return if in a None state |
returns | noneValue if the optional is in a None state, otherwise the bound Some(x) value is returned |
method Task<A?> IfNoneUnsafeAsync <A> (this Option<A> self, Func<A?> None) Source #
Returns the result of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned.
Will allow null the be returned from the None operation
param | None | Operation to invoke if the structure is in a None state |
returns | Tesult of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned. |
method Task<A?> IfNoneUnsafeAsync <A> (this Option<A> self, Func<Task<A?>> None) Source #
Returns the result of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned.
Will allow null the be returned from the None operation
param | None | Operation to invoke if the structure is in a None state |
returns | Tesult of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned. |
method Task<A?> IfNoneUnsafeAsync <A> (this Option<A> self, A? noneValue) Source #
Returns the noneValue if the optional is in a None state, otherwise the bound Some(x) value is returned.
Will allow noneValue to be null
param | noneValue | Value to return if in a None state |
returns | noneValue if the optional is in a None state, otherwise the bound Some(x) value is returned |
method Task<S> FoldAsync <S, A> (this Option<A> self, S state, Func<S, A, S> folder) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | folder | Folder function, applied if Option is in a Some state |
returns | The aggregate state |
method Task<S> FoldAsync <S, A> (this Option<A> self, S state, Func<S, A, Task<S>> folder) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | folder | Folder function, applied if Option is in a Some state |
returns | The aggregate state |
method Task<S> FoldBackAsync <S, A> (this Option<A> self, S state, Func<S, A, S> folder) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | folder | Folder function, applied if Option is in a Some state |
returns | The aggregate state |
method Task<S> FoldBackAsync <S, A> (this Option<A> self, S state, Func<S, A, Task<S>> folder) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | folder | Folder function, applied if Option is in a Some state |
returns | The aggregate state |
method Task<S> BiFoldAsync <S, A> (this Option<A> self, S state, Func<S, A, S> Some, Func<S, Unit, S> None) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | Some | Folder function, applied if Option is in a Some state |
param | None | Folder function, applied if Option is in a None state |
returns | The aggregate state |
method Task<S> BiFoldAsync <S, A> (this Option<A> self, S state, Func<S, A, Task<S>> Some, Func<S, Unit, S> None) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | Some | Folder function, applied if Option is in a Some state |
param | None | Folder function, applied if Option is in a None state |
returns | The aggregate state |
method Task<S> BiFoldAsync <S, A> (this Option<A> self, S state, Func<S, A, S> Some, Func<S, Unit, Task<S>> None) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | Some | Folder function, applied if Option is in a Some state |
param | None | Folder function, applied if Option is in a None state |
returns | The aggregate state |
method Task<S> BiFoldAsync <S, A> (this Option<A> self, S state, Func<S, A, Task<S>> Some, Func<S, Unit, Task<S>> None) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | Some | Folder function, applied if Option is in a Some state |
param | None | Folder function, applied if Option is in a None state |
returns | The aggregate state |
method Task<S> BiFoldAsync <S, A> (this Option<A> self, S state, Func<S, A, S> Some, Func<S, S> None) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | Some | Folder function, applied if Option is in a Some state |
param | None | Folder function, applied if Option is in a None state |
returns | The aggregate state |
method Task<S> BiFoldAsync <S, A> (this Option<A> self, S state, Func<S, A, Task<S>> Some, Func<S, S> None) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | Some | Folder function, applied if Option is in a Some state |
param | None | Folder function, applied if Option is in a None state |
returns | The aggregate state |
method Task<S> BiFoldAsync <S, A> (this Option<A> self, S state, Func<S, A, S> Some, Func<S, Task<S>> None) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | Some | Folder function, applied if Option is in a Some state |
param | None | Folder function, applied if Option is in a None state |
returns | The aggregate state |
method Task<S> BiFoldAsync <S, A> (this Option<A> self, S state, Func<S, A, Task<S>> Some, Func<S, Task<S>> None) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | Some | Folder function, applied if Option is in a Some state |
param | None | Folder function, applied if Option is in a None state |
returns | The aggregate state |
method OptionAsync<B> BiMapAsync <A, B> (this Option<A> self, Func<A, B> Some, Func<Unit, B> None) Source #
Projection from one value to another
type | B | Resulting functor value type |
param | Some | Projection function |
param | None | Projection function |
returns | Mapped functor |
method OptionAsync<B> BiMapAsync <A, B> (this Option<A> self, Func<A, B> Some, Func<B> None) Source #
Projection from one value to another
type | B | Resulting functor value type |
param | Some | Projection function |
param | None | Projection function |
returns | Mapped functor |
method Task<int> CountAsync <A> (this Option<A> self) Source #
Return the number of bound values in this structure:
None = 0
Some = 1
returns |
method Task<bool> ForAllAsync <A> (this Option<A> self, Func<A, bool> pred) Source #
Apply a predicate to the bound value. If the Option is in a None state then True is returned (because the predicate applies for-all values). If the Option is in a Some state the value is the result of running applying the bound value to the predicate supplied.
param | pred | |
returns | If the Option is in a None state then True is returned (because the predicate applies for-all values). If the Option is in a Some state the value is the result of running applying the bound value to the predicate supplied. |
method Task<bool> BiForAllAsync <A> (this Option<A> self, Func<A, bool> Some, Func<Unit, bool> None) Source #
Apply a predicate to the bound value. If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied.
param | Some | Predicate to apply if in a Some state |
param | None | Predicate to apply if in a None state |
returns | If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied. |
method Task<bool> BiForAllAsync <A> (this Option<A> self, Func<A, bool> Some, Func<bool> None) Source #
Apply a predicate to the bound value. If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied.
param | Some | Predicate to apply if in a Some state |
param | None | Predicate to apply if in a None state |
returns | If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied. |
method Task<bool> ExistsAsync <A> (this Option<A> self, Func<A, bool> pred) Source #
Apply a predicate to the bound value. If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied.
param | pred | |
returns | If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied. |
method Task<bool> BiExistsAsync <A> (this Option<A> self, Func<A, bool> Some, Func<Unit, bool> None) Source #
Apply a predicate to the bound value. If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied.
param | pred | |
returns | If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied. |
method Task<bool> BiExistsAsync <A> (this Option<A> self, Func<A, bool> Some, Func<bool> None) Source #
Apply a predicate to the bound value. If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied.
param | pred | |
returns | If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied. |
method Task<Unit> IterAsync <A> (this Option<A> self, Action<A> Some) Source #
Invoke an action for the bound value (if in a Some state)
param | Some | Action to invoke |
method Task<Unit> IterAsync <A> (this Option<A> self, Func<A, Task<Unit>> Some) Source #
Invoke an action for the bound value (if in a Some state)
param | Some | Action to invoke |
method Task<Unit> BiIterAsync <A> (this Option<A> self, Action<A> Some, Action<Unit> None) Source #
Invoke an action depending on the state of the Option
param | Some | Action to invoke if in a Some state |
param | None | Action to invoke if in a None state |
method Task<Unit> BiIterAsync <A> (this Option<A> self, Action<A> Some, Action None) Source #
Invoke an action depending on the state of the Option
param | Some | Action to invoke if in a Some state |
param | None | Action to invoke if in a None state |
method OptionAsync<A> FilterAsync <A> (this Option<A> self, Func<A, bool> pred) Source #
Apply a predicate to the bound value (if in a Some state)
param | pred | Predicate to apply |
returns | Some(x) if the Option is in a Some state and the predicate returns True. None otherwise. |
method OptionAsync<A> FilterAsync <A> (this Option<A> self, Func<A, Task<bool>> pred) Source #
Apply a predicate to the bound value (if in a Some state)
param | pred | Predicate to apply |
returns | Some(x) if the Option is in a Some state and the predicate returns True. None otherwise. |
method OptionAsync<A> AddAsync <NUM, A> (this Option<A> x, Option<A> 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 | Add 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 OptionAsync<A> SubtractAsync <NUM, A> (this Option<A> x, Option<A> 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 | Subtract 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 OptionAsync<A> ProductAsync <NUM, A> (this Option<A> x, Option<A> 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 | Product 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 OptionAsync<A> DivideAsync <NUM, A> (this Option<A> x, Option<A> 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 | Divide 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 OptionAsync<B> ApplyAsync <A, B> (this Option<Func<A, B>> fab, Option<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 OptionAsync<B> ApplyAsync <A, B> (this Func<A, B> fab, Option<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 OptionAsync<C> ApplyAsync <A, B, C> (this Option<Func<A, B, C>> fabc, Option<A> fa, Option<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 OptionAsync<C> ApplyAsync <A, B, C> (this Func<A, B, C> fabc, Option<A> fa, Option<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 OptionAsync<Func<B, C>> ApplyAsync <A, B, C> (this Option<Func<A, B, C>> fabc, Option<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 OptionAsync<Func<B, C>> ApplyAsync <A, B, C> (this Func<A, B, C> fabc, Option<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 OptionAsync<Func<B, C>> ApplyAsync <A, B, C> (this Option<Func<A, Func<B, C>>> fabc, Option<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 OptionAsync<Func<B, C>> ApplyAsync <A, B, C> (this Func<A, Func<B, C>> fabc, Option<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 OptionAsync<B> ActionAsync <A, B> (this Option<A> fa, Option<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 OptionAsync |
class OptionExtensions Source #
Extension methods for Option
method IEnumerable<A> Somes <A> (this IEnumerable<Option<A>> self) Source #
Extracts from a list of Option
all the Some
elements.
All the Some
elements are extracted in order.
method Seq<A> Somes <A> (this Seq<Option<A>> self) Source #
Extracts from a list of Option
all the Some
elements.
All the Some
elements are extracted in order.
method Option<A> Add <ARITH, A> (this Option<A> x, Option<A> 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 | ADD | Add 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 Option<A> Subtract <ARITH, A> (this Option<A> x, Option<A> 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 | DIFF | Subtract 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 Option<A> Product <ARITH, A> (this Option<A> x, Option<A> 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 | PROD | Product 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 Option<A> Divide <NUM, A> (this Option<A> x, Option<A> 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 | DIV | Divide 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 Option<B> Apply <A, B> (this Option<Func<A, B>> fab, Option<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 Option<B> Apply <A, B> (this Func<A, B> fab, Option<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 Option<C> Apply <A, B, C> (this Option<Func<A, B, C>> fabc, Option<A> fa, Option<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 Option<C> Apply <A, B, C> (this Func<A, B, C> fabc, Option<A> fa, Option<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 Option<Func<B, C>> Apply <A, B, C> (this Option<Func<A, B, C>> fabc, Option<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 Option<Func<B, C>> Apply <A, B, C> (this Func<A, B, C> fabc, Option<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 Option<Func<B, C>> Apply <A, B, C> (this Option<Func<A, Func<B, C>>> fabc, Option<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 Option<Func<B, C>> Apply <A, B, C> (this Func<A, Func<B, C>> fabc, Option<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 Option<B> Action <A, B> (this Option<A> fa, Option<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 A? ToNullable <A> (this Option<A> ma) Source #
Convert the Option type to a Nullable of A
type | A | Type of the bound value |
param | ma | Option to convert |
returns | Nullable of A |
method R Match <R> (this Option<bool> ma, Func<R> True, Func<R> False, Func<R> None) Source #
Match for an optional boolean
type | R | |
param | ma | Optional boolean |
param | True | Match for Some(true) |
param | False | Match for Some(false) |
param | None | Match for None |
returns |
method IEnumerable<R> Match <T, R> (this IEnumerable<Option<T>> list, Func<T, IEnumerable<R>> Some, Func<IEnumerable<R>> None ) Source #
Match over a list of options
type | T | Type of the bound values |
type | R | Result type |
param | list | List of options to match against |
param | Some | Operation to perform when an Option is in the Some state |
param | None | Operation to perform when an Option is in the None state |
returns | An enumerable of results of the match operations |
method IEnumerable<R> Match <T, R> (this IEnumerable<Option<T>> list, Func<T, IEnumerable<R>> Some, IEnumerable<R> None) Source #
Match over a list of options
type | T | Type of the bound values |
type | R | Result type |
param | list | List of options to match against |
param | Some | Operation to perform when an Option is in the Some state |
param | None | Default if the list is empty |
returns | An enumerable of results of the match operations |
method Option<T> subtract <NUM, T> (Option<T> lhs, Option<T> rhs) Source #
Subtract the Ts
param | lhs | Left-hand side of the operation |
param | rhs | Right-hand side of the operation |
returns | lhs - rhs |
method Option<T> product <NUM, T> (Option<T> lhs, Option<T> rhs) Source #
method Option<T> divide <NUM, T> (Option<T> lhs, Option<T> rhs) Source #
Divide the Ts
param | lhs | Left-hand side of the operation |
param | rhs | Right-hand side of the operation |
returns | lhs / rhs |
method Option<T> add <NUM, T> (Option<T> lhs, Option<T> rhs) Source #
Add the Ts
param | lhs | Left-hand side of the operation |
param | rhs | Right-hand side of the operation |
returns | lhs / rhs |
method bool isSome <T> (Option<T> value) Source #
Check if Option is in a Some state
type | T | T |
param | value | Option |
returns | True if value is in a Some state |
method bool isNone <T> (Option<T> value) Source #
Check if Option is in a None state
type | T | T |
param | value | Option |
returns | True if value is in a None state |
method Option<A> Some <A> (A value) Source #
Create a Some
of A
type | A | Bound value type |
param | value | Non-null value to be made optional |
returns |
|
method Option<A> Some <A> (A? value) Source #
Create a Some
of A
from a Nullable<A>
type | A | Bound value type |
param | value | Non-null value to be made optional |
returns |
|
method Option<A> Optional <A> (A? value) Source #
Create an Option
of A
type | A | Bound value type |
param | value | Value to be made optional, or |
returns | If the value is |
method Option<A> Optional <A> (A? value) Source #
Create an Option
of A
type | A | Bound value type |
param | value | Value to be made optional, or null |
returns | If the value is |
method Unit ifSome <T> (Option<T> option, Action<T> Some) Source #
Invokes the action if Option is in the Some state, otherwise nothing happens.
param | f | Action to invoke if Option is in the Some state |
method T ifNone <T> (Option<T> option, Func<T> None) Source #
Returns the result of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned.
Will not accept a null return value from the None operation
param | None | Operation to invoke if the structure is in a None state |
returns | Tesult of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned. |
method T ifNone <T> (Option<T> option, T noneValue) Source #
Returns the noneValue if the optional is in a None state, otherwise the bound Some(x) value is returned.
Will not accept a null noneValue
param | noneValue | Value to return if in a None state |
returns | noneValue if the optional is in a None state, otherwise the bound Some(x) value is returned |
method T? ifNoneUnsafe <T> (Option<T> option, Func<T?> None) Source #
Returns the result of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned.
Will allow null the be returned from the None operation
param | None | Operation to invoke if the structure is in a None state |
returns | Tesult of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned. |
method T? ifNoneUnsafe <T> (Option<T> option, T? noneValue) Source #
Returns the noneValue if the optional is in a None state, otherwise the bound Some(x) value is returned.
Will allow noneValue to be null
param | noneValue | Value to return if in a None state |
returns | noneValue if the optional is in a None state, otherwise the bound Some(x) value is returned |
method R match <T, R> (Option<T> option, Func<T, R> Some, Func<R> None) Source #
Match the two states of the Option and return a non-null R.
type | B | Return type |
param | Some | Some match operation. Must not return null. |
param | None | None match operation. Must not return null. |
returns | A non-null B |
method R? matchUnsafe <T, R> (Option<T> option, Func<T, R?> Some, Func<R?> None) Source #
Match the two states of the Option and return a B, which can be null.
type | B | Return type |
param | Some | Some match operation. May return null. |
param | None | None match operation. May return null. |
returns | B, or null |
method Unit match <T> (Option<T> option, Action<T> Some, Action None) Source #
Match the two states of the Option
param | Some | Some match operation |
param | None | None match operation |
method Option<B> apply <A, B> (Option<Func<A, B>> fab, Option<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 Option<B> apply <A, B> (Func<A, B> fab, Option<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 Option<C> apply <A, B, C> (Option<Func<A, B, C>> fabc, Option<A> fa, Option<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 Option<C> apply <A, B, C> (Func<A, B, C> fabc, Option<A> fa, Option<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 Option<Func<B, C>> apply <A, B, C> (Option<Func<A, B, C>> fabc, Option<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 Option<Func<B, C>> apply <A, B, C> (Func<A, B, C> fabc, Option<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 Option<Func<B, C>> apply <A, B, C> (Option<Func<A, Func<B, C>>> fabc, Option<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 Option<Func<B, C>> apply <A, B, C> (Func<A, Func<B, C>> fabc, Option<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 Option<B> action <A, B> (Option<A> fa, Option<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 S fold <S, A> (Option<A> option, S state, Func<S, A, S> folder) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | folder | Folder function, applied if Option is in a Some state |
returns | The aggregate state |
method S bifold <S, A> (Option<A> option, S state, Func<S, A, S> Some, Func<S, S> None) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | Some | Folder function, applied if Option is in a Some state |
param | None | Folder function, applied if Option is in a None state |
returns | The aggregate state |
method S bifold <S, A> (Option<A> option, S state, Func<S, A, S> Some, Func<S, Unit, S> None) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | Some | Folder function, applied if Option is in a Some state |
param | None | Folder function, applied if Option is in a None state |
returns | The aggregate state |
method bool forall <A> (Option<A> option, Func<A, bool> pred) Source #
Apply a predicate to the bound value. If the Option is in a None state then True is returned (because the predicate applies for-all values). If the Option is in a Some state the value is the result of running applying the bound value to the predicate supplied.
param | pred | Predicate to apply |
returns | If the Option is in a None state then True is returned (because the predicate applies for-all values). If the Option is in a Some state the value is the result of running applying the bound value to the predicate supplied. |
method bool biforall <A> (Option<A> option, Func<A, bool> Some, Func<Unit, bool> None) Source #
Apply a predicate to the bound value. If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied.
param | Some | Predicate to apply if in a Some state |
param | None | Predicate to apply if in a None state |
returns | If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied. |
method bool biforall <A> (Option<A> option, Func<A, bool> Some, Func<bool> None) Source #
Apply a predicate to the bound value. If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied.
param | Some | Predicate to apply if in a Some state |
param | None | Predicate to apply if in a None state |
returns | If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied. |
method int count <A> (Option<A> option) Source #
Return the number of bound values in this structure:
None = 0
Some = 1
returns |
method bool exists <A> (Option<A> option, Func<A, bool> pred) Source #
Apply a predicate to the bound value. If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied.
param | pred | Predicate to apply |
returns | If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied. |
method bool biexists <A> (Option<A> option, Func<A, bool> Some, Func<Unit, bool> None) Source #
Apply a predicate to the bound value. If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied.
param | Some | Predicate to apply if in a Some state |
param | None | Predicate to apply if in a None state |
returns | If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied. |
method bool biexists <A> (Option<A> option, Func<A, bool> Some, Func<bool> None) Source #
Apply a predicate to the bound value. If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied.
param | Some | Predicate to apply if in a Some state |
param | None | Predicate to apply if in a None state |
returns | If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied. |
method Option<B> map <A, B> (Option<A> option, Func<A, B> f) Source #
Projection from one value to another
type | B | Resulting functor value type |
param | f | Projection function |
returns | Mapped functor |
method Option<B> bimap <A, B> (Option<A> option, Func<A, B> Some, Func<B> None) Source #
Projection from one value to another
type | B | Resulting functor value type |
param | Some | Projection function |
param | None | Projection function |
returns | Mapped functor |
method Option<B> bimap <A, B> (Option<A> option, Func<A, B> Some, Func<Unit, B> None) Source #
Projection from one value to another
type | B | Resulting functor value type |
param | Some | Projection function |
param | None | Projection function |
returns | Mapped functor |
method Option<Func<T2, R>> parmap <T1, T2, R> (Option<T1> option, Func<T1, T2, R> mapper) Source #
Partial application map
method Option<Func<T2, Func<T3, R>>> parmap <T1, T2, T3, R> (Option<T1> option, Func<T1, T2, T3, R> mapper) Source #
Partial application map
method Option<T> filter <T> (Option<T> option, Func<T, bool> pred) Source #
Apply a predicate to the bound value (if in a Some state)
param | pred | Predicate to apply |
returns | Some(x) if the Option is in a Some state and the predicate returns True. None otherwise. |
method Option<R> bind <T, R> (Option<T> option, Func<T, Option<R>> binder) Source #
Monadic bind operation
method IEnumerable<R> match <T, R> (IEnumerable<Option<T>> list, Func<T, IEnumerable<R>> Some, Func<IEnumerable<R>> None ) Source #
Match the two states of the list of Options
param | Some | Some match operation |
param | None | None match operation |
method IEnumerable<R> match <T, R> (IEnumerable<Option<T>> list, Func<T, IEnumerable<R>> Some, IEnumerable<R> None) Source #
Match the two states of the list of Options
param | Some | Some match operation |
param | None | None match operation |
method IEnumerable<T> somes <T> (IEnumerable<Option<T>> list) Source #
Extracts from a list of 'Option' all the 'Some' elements. All the 'Some' elements are extracted in order.
class TaskOptionAsyncExtensions Source #
method OptionAsync<B> MapAsync <A, B> (this Task<Option<A>> self, Func<A, B> f) Source #
Projection from one value to another
type | B | Resulting functor value type |
param | f | Projection function |
returns | Mapped functor |
method OptionAsync<B> MapAsync <A, B> (this Task<Option<A>> self, Func<A, Task<B>> f) Source #
Projection from one value to another
type | B | Resulting functor value type |
param | f | Projection function |
returns | Mapped functor |
method OptionAsync<B> BindAsync <A, B> (this Task<Option<A>> self, Func<A, Option<B>> f) Source #
Monad bind operation
method OptionAsync<B> BindAsync <A, B> (this Task<Option<A>> self, Func<A, Task<Option<B>>> f) Source #
Monad bind operation
method OptionAsync<B> BindAsync <A, B> (this Task<Option<A>> self, Func<A, OptionAsync<B>> f) Source #
Monad bind operation
method OptionAsync<B> BindAsync <A, B> (this Task<Option<A>> self, Func<A, Task<OptionAsync<B>>> f) Source #
Monad bind operation
method Task<R> MatchUntypedAsync <A, R> (this Task<Option<A>> self, Func<object, R> Some, Func<R> None) Source #
Match operation with an untyped value for Some. This can be useful for serialisation and dealing with the IOptional interface
type | R | The return type |
param | Some | Operation to perform if the option is in a Some state |
param | None | Operation to perform if the option is in a None state |
returns | The result of the match operation |
method Task<R> MatchUntypedAsync <A, R> (this Task<Option<A>> self, Func<object, Task<R>> Some, Func<R> None) Source #
Match operation with an untyped value for Some. This can be useful for serialisation and dealing with the IOptional interface
type | R | The return type |
param | Some | Operation to perform if the option is in a Some state |
param | None | Operation to perform if the option is in a None state |
returns | The result of the match operation |
method Task<R> MatchUntypedAsync <A, R> (this Task<Option<A>> self, Func<object, R> Some, Func<Task<R>> None) Source #
Match operation with an untyped value for Some. This can be useful for serialisation and dealing with the IOptional interface
type | R | The return type |
param | Some | Operation to perform if the option is in a Some state |
param | None | Operation to perform if the option is in a None state |
returns | The result of the match operation |
method Task<R> MatchUntypedAsync <A, R> (this Task<Option<A>> self, Func<object, Task<R>> Some, Func<Task<R>> None) Source #
Match operation with an untyped value for Some. This can be useful for serialisation and dealing with the IOptional interface
type | R | The return type |
param | Some | Operation to perform if the option is in a Some state |
param | None | Operation to perform if the option is in a None state |
returns | The result of the match operation |
method Task<Arr<A>> ToArrayAsync <A> (this Task<Option<A>> self) Source #
Convert the Option to an enumerable of zero or one items
returns | An enumerable of zero or one items |
method Task<Lst<A>> ToListAsync <A> (this Task<Option<A>> self) Source #
Convert the Option to an immutable list of zero or one items
returns | An immutable list of zero or one items |
method Task<Seq<A>> ToSeqAsync <A> (this Task<Option<A>> self) Source #
Convert the Option to an enumerable sequence of zero or one items
returns | An enumerable sequence of zero or one items |
method Task<IEnumerable<A>> AsEnumerableAsync <A> (this Task<Option<A>> self) Source #
Convert the Option to an enumerable of zero or one items
returns | An enumerable of zero or one items |
method EitherAsync<L, A> ToEitherAsync <L, A> (this Task<Option<A>> self, L defaultLeftValue) Source #
Convert the structure to an Either
param | defaultLeftValue | Default value if the structure is in a None state |
returns | An Either representation of the structure |
method EitherAsync<L, A> ToEitherAsync <L, A> (this Task<Option<A>> self, Func<L> Left) Source #
Convert the structure to an Either
param | defaultLeftValue | Function to invoke to get a default value if the structure is in a None state |
returns | An Either representation of the structure |
method Task<EitherUnsafe<L, A>> ToEitherUnsafeAsync <L, A> (this Task<Option<A>> self, L? defaultLeftValue) Source #
Convert the structure to an EitherUnsafe
param | defaultLeftValue | Default value if the structure is in a None state |
returns | An EitherUnsafe representation of the structure |
method Task<EitherUnsafe<L, A>> ToEitherUnsafeAsync <L, A> (this Task<Option<A>> self, Func<L?> Left) Source #
Convert the structure to an EitherUnsafe
param | defaultLeftValue | Function to invoke to get a default value if the structure is in a None state |
returns | An EitherUnsafe representation of the structure |
method Task<OptionUnsafe<A>> ToOptionUnsafeAsync <A> (this Task<Option<A>> self) Source #
Convert the structure to a OptionUnsafe
returns | An OptionUnsafe representation of the structure |
method TryOptionAsync<A> ToTryOptionAsync <A> (this Task<Option<A>> self) Source #
Convert the structure to a TryOptionAsync
returns | A TryOptionAsync representation of the structure |
method TryAsync<A> ToTryAsync <A> (this Task<Option<A>> self) Source #
Convert the structure to a TryAsync
returns | A TryAsync representation of the structure |
method Task<B> Match <A, B> (this Task<Option<A>> self, Func<A, B> Some, Func<B> None) Source #
Match the two states of the Option and return a non-null R.
type | B | Return type |
param | Some | Some match operation. Must not return null. |
param | None | None match operation. Must not return null. |
returns | A non-null B |
method Task<B> MatchAsync <A, B> (this Task<Option<A>> self, Func<A, Task<B>> Some, Func<B> None) Source #
Match the two states of the Option and return a non-null R.
type | B | Return type |
param | Some | Some match operation. Must not return null. |
param | None | None match operation. Must not return null. |
returns | A non-null B |
method Task<B> MatchAsync <A, B> (this Task<Option<A>> self, Func<A, B> Some, Func<Task<B>> None) Source #
Match the two states of the Option and return a non-null R.
type | B | Return type |
param | Some | Some match operation. Must not return null. |
param | None | None match operation. Must not return null. |
returns | A non-null B |
method Task<B> MatchAsync <A, B> (this Task<Option<A>> self, Func<A, Task<B>> Some, Func<Task<B>> None) Source #
Match the two states of the Option and return a non-null R.
type | B | Return type |
param | Some | Some match operation. Must not return null. |
param | None | None match operation. Must not return null. |
returns | A non-null B |
method Task<B?> MatchUnsafe <A, B> (this Task<Option<A>> self, Func<A, B?> Some, Func<B?> None) Source #
Match the two states of the Option and return a B, which can be null.
type | B | Return type |
param | Some | Some match operation. May return null. |
param | None | None match operation. May return null. |
returns | B, or null |
method Task<B?> MatchUnsafeAsync <A, B> (this Task<Option<A>> self, Func<A, Task<B?>> Some, Func<B?> None) Source #
Match the two states of the Option and return a B, which can be null.
type | B | Return type |
param | Some | Some match operation. May return null. |
param | None | None match operation. May return null. |
returns | B, or null |
method Task<B?> MatchUnsafeAsync <A, B> (this Task<Option<A>> self, Func<A, B?> Some, Func<Task<B?>> None) Source #
Match the two states of the Option and return a B, which can be null.
type | B | Return type |
param | Some | Some match operation. May return null. |
param | None | None match operation. May return null. |
returns | B, or null |
method Task<B?> MatchUnsafeAsync <A, B> (this Task<Option<A>> self, Func<A, Task<B?>> Some, Func<Task<B?>> None) Source #
Match the two states of the Option and return a B, which can be null.
type | B | Return type |
param | Some | Some match operation. May return null. |
param | None | None match operation. May return null. |
returns | B, or null |
method Task<Unit> Match <A> (this Task<Option<A>> self, Action<A> Some, Action None) Source #
Match the two states of the Option
param | Some | Some match operation |
param | None | None match operation |
method Task<Unit> IfSomeAsync <A> (this Task<Option<A>> self, Action<A> f) Source #
Invokes the action if Option is in the Some state, otherwise nothing happens.
param | f | Action to invoke if Option is in the Some state |
method Task<Unit> IfSomeAsync <A> (this Task<Option<A>> self, Func<A, Task<Unit>> f) Source #
Invokes the f function if Option is in the Some state, otherwise nothing happens.
param | f | Function to invoke if Option is in the Some state |
method Task<Unit> IfSomeAsync <A> (this Task<Option<A>> self, Func<A, Task> f) Source #
Invokes the f function if Option is in the Some state, otherwise nothing happens.
param | f | Function to invoke if Option is in the Some state |
method Task<Unit> IfSomeAsync <A> (this Task<Option<A>> self, Func<A, Unit> f) Source #
Invokes the f function if Option is in the Some state, otherwise nothing happens.
param | f | Function to invoke if Option is in the Some state |
method Task<A> IfNoneAsync <A> (this Task<Option<A>> self, Func<A> None) Source #
Returns the result of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned.
Will not accept a null return value from the None operation
param | None | Operation to invoke if the structure is in a None state |
returns | Tesult of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned. |
method Task<A> IfNoneAsync <A> (this Task<Option<A>> self, Func<Task<A>> None) Source #
Returns the result of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned.
Will not accept a null return value from the None operation
param | None | Operation to invoke if the structure is in a None state |
returns | Tesult of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned. |
method Task<A> IfNoneAsync <A> (this Task<Option<A>> self, A noneValue) Source #
Returns the noneValue if the optional is in a None state, otherwise the bound Some(x) value is returned.
Will not accept a null noneValue
param | noneValue | Value to return if in a None state |
returns | noneValue if the optional is in a None state, otherwise the bound Some(x) value is returned |
method Task<A?> IfNoneUnsafeAsync <A> (this Task<Option<A>> self, Func<A?> None) Source #
Returns the result of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned.
Will allow null the be returned from the None operation
param | None | Operation to invoke if the structure is in a None state |
returns | Tesult of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned. |
method Task<A?> IfNoneUnsafeAsync <A> (this Task<Option<A>> self, Func<Task<A?>> None) Source #
Returns the result of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned.
Will allow null the be returned from the None operation
param | None | Operation to invoke if the structure is in a None state |
returns | Tesult of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned. |
method Task<A?> IfNoneUnsafeAsync <A> (this Task<Option<A>> self, A? noneValue) Source #
Returns the noneValue if the optional is in a None state, otherwise the bound Some(x) value is returned.
Will allow noneValue to be null
param | noneValue | Value to return if in a None state |
returns | noneValue if the optional is in a None state, otherwise the bound Some(x) value is returned |
method Task<S> FoldAsync <S, A> (this Task<Option<A>> self, S state, Func<S, A, S> folder) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | folder | Folder function, applied if Option is in a Some state |
returns | The aggregate state |
method Task<S> FoldAsync <S, A> (this Task<Option<A>> self, S state, Func<S, A, Task<S>> folder) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | folder | Folder function, applied if Option is in a Some state |
returns | The aggregate state |
method Task<S> FoldBackAsync <S, A> (this Task<Option<A>> self, S state, Func<S, A, S> folder) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | folder | Folder function, applied if Option is in a Some state |
returns | The aggregate state |
method Task<S> FoldBackAsync <S, A> (this Task<Option<A>> self, S state, Func<S, A, Task<S>> folder) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | folder | Folder function, applied if Option is in a Some state |
returns | The aggregate state |
method Task<S> BiFoldAsync <S, A> (this Task<Option<A>> self, S state, Func<S, A, S> Some, Func<S, Unit, S> None) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | Some | Folder function, applied if Option is in a Some state |
param | None | Folder function, applied if Option is in a None state |
returns | The aggregate state |
method Task<S> BiFoldAsync <S, A> (this Task<Option<A>> self, S state, Func<S, A, Task<S>> Some, Func<S, Unit, S> None) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | Some | Folder function, applied if Option is in a Some state |
param | None | Folder function, applied if Option is in a None state |
returns | The aggregate state |
method Task<S> BiFoldAsync <S, A> (this Task<Option<A>> self, S state, Func<S, A, S> Some, Func<S, Unit, Task<S>> None) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | Some | Folder function, applied if Option is in a Some state |
param | None | Folder function, applied if Option is in a None state |
returns | The aggregate state |
method Task<S> BiFoldAsync <S, A> (this Task<Option<A>> self, S state, Func<S, A, Task<S>> Some, Func<S, Unit, Task<S>> None) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | Some | Folder function, applied if Option is in a Some state |
param | None | Folder function, applied if Option is in a None state |
returns | The aggregate state |
method Task<S> BiFoldAsync <S, A> (this Task<Option<A>> self, S state, Func<S, A, S> Some, Func<S, S> None) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | Some | Folder function, applied if Option is in a Some state |
param | None | Folder function, applied if Option is in a None state |
returns | The aggregate state |
method Task<S> BiFoldAsync <S, A> (this Task<Option<A>> self, S state, Func<S, A, Task<S>> Some, Func<S, S> None) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | Some | Folder function, applied if Option is in a Some state |
param | None | Folder function, applied if Option is in a None state |
returns | The aggregate state |
method Task<S> BiFoldAsync <S, A> (this Task<Option<A>> self, S state, Func<S, A, S> Some, Func<S, Task<S>> None) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | Some | Folder function, applied if Option is in a Some state |
param | None | Folder function, applied if Option is in a None state |
returns | The aggregate state |
method Task<S> BiFoldAsync <S, A> (this Task<Option<A>> self, S state, Func<S, A, Task<S>> Some, Func<S, Task<S>> None) Source #
Option 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:
Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, 'Fold' can produce a terminating expression from an infinite list.
type | S | Aggregate state type |
param | state | Initial state |
param | Some | Folder function, applied if Option is in a Some state |
param | None | Folder function, applied if Option is in a None state |
returns | The aggregate state |
method OptionAsync<B> BiMapAsync <A, B> (this Task<Option<A>> self, Func<A, B> Some, Func<Unit, B> None) Source #
Projection from one value to another
type | B | Resulting functor value type |
param | Some | Projection function |
param | None | Projection function |
returns | Mapped functor |
method OptionAsync<B> BiMapAsync <A, B> (this Task<Option<A>> self, Func<A, Task<B>> Some, Func<Unit, B> None) Source #
Projection from one value to another
type | B | Resulting functor value type |
param | Some | Projection function |
param | None | Projection function |
returns | Mapped functor |
method OptionAsync<B> BiMapAsync <A, B> (this Task<Option<A>> self, Func<A, Task<B>> Some, Func<Unit, Task<B>> None) Source #
Projection from one value to another
type | B | Resulting functor value type |
param | Some | Projection function |
param | None | Projection function |
returns | Mapped functor |
method OptionAsync<B> BiMapAsync <A, B> (this Task<Option<A>> self, Func<A, B> Some, Func<Unit, Task<B>> None) Source #
Projection from one value to another
type | B | Resulting functor value type |
param | Some | Projection function |
param | None | Projection function |
returns | Mapped functor |
method OptionAsync<B> BiMapAsync <A, B> (this Task<Option<A>> self, Func<A, B> Some, Func<B> None) Source #
Projection from one value to another
type | B | Resulting functor value type |
param | Some | Projection function |
param | None | Projection function |
returns | Mapped functor |
method OptionAsync<B> BiMapAsync <A, B> (this Task<Option<A>> self, Func<A, Task<B>> Some, Func<B> None) Source #
Projection from one value to another
type | B | Resulting functor value type |
param | Some | Projection function |
param | None | Projection function |
returns | Mapped functor |
method OptionAsync<B> BiMapAsync <A, B> (this Task<Option<A>> self, Func<A, Task<B>> Some, Func<Task<B>> None) Source #
Projection from one value to another
type | B | Resulting functor value type |
param | Some | Projection function |
param | None | Projection function |
returns | Mapped functor |
method OptionAsync<B> BiMapAsync <A, B> (this Task<Option<A>> self, Func<A, B> Some, Func<Task<B>> None) Source #
Projection from one value to another
type | B | Resulting functor value type |
param | Some | Projection function |
param | None | Projection function |
returns | Mapped functor |
method Task<int> CountAsync <A> (this Task<Option<A>> self) Source #
Return the number of bound values in this structure:
None = 0
Some = 1
returns |
method Task<bool> ForAllAsync <A> (this Task<Option<A>> self, Func<A, bool> pred) Source #
Apply a predicate to the bound value. If the Option is in a None state then True is returned (because the predicate applies for-all values). If the Option is in a Some state the value is the result of running applying the bound value to the predicate supplied.
param | pred | |
returns | If the Option is in a None state then True is returned (because the predicate applies for-all values). If the Option is in a Some state the value is the result of running applying the bound value to the predicate supplied. |
method Task<bool> BiForAllAsync <A> (this Task<Option<A>> self, Func<A, bool> Some, Func<Unit, bool> None) Source #
Apply a predicate to the bound value. If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied.
param | Some | Predicate to apply if in a Some state |
param | None | Predicate to apply if in a None state |
returns | If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied. |
method Task<bool> BiForAllAsync <A> (this Task<Option<A>> self, Func<A, bool> Some, Func<bool> None) Source #
Apply a predicate to the bound value. If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied.
param | Some | Predicate to apply if in a Some state |
param | None | Predicate to apply if in a None state |
returns | If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied. |
method Task<bool> ExistsAsync <A> (this Task<Option<A>> self, Func<A, bool> pred) Source #
Apply a predicate to the bound value. If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied.
param | pred | |
returns | If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied. |
method Task<bool> BiExistsAsync <A> (this Task<Option<A>> self, Func<A, bool> Some, Func<Unit, bool> None) Source #
Apply a predicate to the bound value. If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied.
param | pred | |
returns | If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied. |
method Task<bool> BiExistsAsync <A> (this Task<Option<A>> self, Func<A, bool> Some, Func<bool> None) Source #
Apply a predicate to the bound value. If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied.
param | pred | |
returns | If the Option is in a None state then True is returned if invoking None returns True. If the Option is in a Some state the value is the result of running applying the bound value to the Some predicate supplied. |
method Task<Unit> IterAsync <A> (this Task<Option<A>> self, Action<A> Some) Source #
Invoke an action for the bound value (if in a Some state)
param | Some | Action to invoke |
method Task<Unit> IterAsync <A> (this Task<Option<A>> self, Func<A, Task<Unit>> Some) Source #
Invoke an action for the bound value (if in a Some state)
param | Some | Action to invoke |
method Task<Unit> BiIterAsync <A> (this Task<Option<A>> self, Action<A> Some, Action<Unit> None) Source #
Invoke an action depending on the state of the Option
param | Some | Action to invoke if in a Some state |
param | None | Action to invoke if in a None state |
method Task<Unit> BiIterAsync <A> (this Task<Option<A>> self, Action<A> Some, Action None) Source #
Invoke an action depending on the state of the Option
param | Some | Action to invoke if in a Some state |
param | None | Action to invoke if in a None state |
method OptionAsync<A> FilterAsync <A> (this Task<Option<A>> self, Func<A, bool> pred) Source #
Apply a predicate to the bound value (if in a Some state)
param | pred | Predicate to apply |
returns | Some(x) if the Option is in a Some state and the predicate returns True. None otherwise. |
method OptionAsync<A> FilterAsync <A> (this Task<Option<A>> self, Func<A, Task<bool>> pred) Source #
Apply a predicate to the bound value (if in a Some state)
param | pred | Predicate to apply |
returns | Some(x) if the Option is in a Some state and the predicate returns True. None otherwise. |
method OptionAsync<A> AddAsync <NUM, A> (this Task<Option<A>> x, Task<Option<A>> 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 | Add 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 OptionAsync<A> SubtractAsync <NUM, A> (this Task<Option<A>> x, Task<Option<A>> 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 | Subtract 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 OptionAsync<A> ProductAsync <NUM, A> (this Task<Option<A>> x, Task<Option<A>> 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 | Product 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 OptionAsync<A> DivideAsync <NUM, A> (this Task<Option<A>> x, Task<Option<A>> 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 | Divide 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 OptionAsync<B> ApplyAsync <A, B> (this Option<Func<A, B>> fab, Task<Option<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 OptionAsync<B> ApplyAsync <A, B> (this Func<A, B> fab, Task<Option<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 OptionAsync<C> ApplyAsync <A, B, C> (this Option<Func<A, B, C>> fabc, Task<Option<A>> fa, Option<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 OptionAsync<C> ApplyAsync <A, B, C> (this Func<A, B, C> fabc, Task<Option<A>> fa, Option<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 OptionAsync<Func<B, C>> ApplyAsync <A, B, C> (this Option<Func<A, B, C>> fabc, Task<Option<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 OptionAsync<Func<B, C>> ApplyAsync <A, B, C> (this Func<A, B, C> fabc, Task<Option<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 OptionAsync<Func<B, C>> ApplyAsync <A, B, C> (this Option<Func<A, Func<B, C>>> fabc, Task<Option<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 OptionAsync<Func<B, C>> ApplyAsync <A, B, C> (this Func<A, Func<B, C>> fabc, Task<Option<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 OptionAsync<B> ActionAsync <A, B> (this Task<Option<A>> fa, Option<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 OptionAsync |