Class MaybeMonad
- Namespace
- SodaFlow.Functional
- Assembly
- SodaFlow.Functional.dll
Provides methods implementing a monad for Maybe<T>.
[PublicAPI]
public static class MaybeMonad
- Inheritance
-
MaybeMonad
- Inherited Members
Methods
- Bind<T, TResult>(Maybe<T>, Func<T, Maybe<TResult>>)
The bind method for the Maybe<T> monad, which transforms an Maybe<T> into an Maybe<T>.
- Return<T>(T)
The return method for the Maybe<T> monad, which encapsulates a value of type
Tin an Maybe<T> monad.
- SelectMany<T1, T2, TResult>(Maybe<T1>, Func<T1, Maybe<T2>>, Func<T1, T2, TResult>)
Implements the LINQ select many operation for the Maybe<T> monad.
- Select<T, TResult>(Maybe<T>, Func<T, TResult>)
Implements the LINQ select operation for the Maybe<T> monad.
- Where<T>(Maybe<T>, Func<T, bool>)
Implements the LINQ where operation for the Maybe<T> monad, keeping the contained value only if it satisfies a predicate.