pub struct EitherTMonad<M, E, A> {
pub inner: Vec<OxiEither<A, E>>,
/* private fields */
}Expand description
A monad transformer wrapper representing M (Either E A).
EitherTMonad is a thin Rust-level encoding of the EitherT transformer,
holding the inner monadic value as an OxiEither<A, E> wrapped in a Vec
(as a stand-in for a generic monad M).
Fields§
§inner: Vec<OxiEither<A, E>>The inner value, represented as M (Either E A).
We use Vec as a concrete stand-in for the monad M.
Implementations§
Source§impl<M, E: Clone, A: Clone> EitherTMonad<M, E, A>
impl<M, E: Clone, A: Clone> EitherTMonad<M, E, A>
Sourcepub fn bind<B: Clone, F>(self, f: F) -> EitherTMonad<M, E, B>where
F: FnOnce(A) -> EitherTMonad<M, E, B>,
pub fn bind<B: Clone, F>(self, f: F) -> EitherTMonad<M, E, B>where
F: FnOnce(A) -> EitherTMonad<M, E, B>,
Bind over the transformer.
Sourcepub fn map<B: Clone, F: FnOnce(A) -> B>(self, f: F) -> EitherTMonad<M, E, B>
pub fn map<B: Clone, F: FnOnce(A) -> B>(self, f: F) -> EitherTMonad<M, E, B>
Map over the success value.
Auto Trait Implementations§
impl<M, E, A> Freeze for EitherTMonad<M, E, A>
impl<M, E, A> RefUnwindSafe for EitherTMonad<M, E, A>
impl<M, E, A> Send for EitherTMonad<M, E, A>
impl<M, E, A> Sync for EitherTMonad<M, E, A>
impl<M, E, A> Unpin for EitherTMonad<M, E, A>
impl<M, E, A> UnsafeUnpin for EitherTMonad<M, E, A>
impl<M, E, A> UnwindSafe for EitherTMonad<M, E, A>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more