pub struct EitherKleisli<E, A, B> {
pub run: Box<dyn Fn(A) -> OxiEither<B, E>>,
}Expand description
A Kleisli arrow A → Either E B in the Either monad’s Kleisli category.
Fields§
§run: Box<dyn Fn(A) -> OxiEither<B, E>>The underlying function from A to OxiEither<B, E>.
Implementations§
Source§impl<E: 'static, A: 'static, B: 'static> EitherKleisli<E, A, B>
impl<E: 'static, A: 'static, B: 'static> EitherKleisli<E, A, B>
Sourcepub fn new<F: Fn(A) -> OxiEither<B, E> + 'static>(f: F) -> Self
pub fn new<F: Fn(A) -> OxiEither<B, E> + 'static>(f: F) -> Self
Construct a new Kleisli arrow from a function.
Sourcepub fn compose<C: 'static>(
self,
g: EitherKleisli<E, B, C>,
) -> EitherKleisli<E, A, C>where
E: Clone + 'static,
pub fn compose<C: 'static>(
self,
g: EitherKleisli<E, B, C>,
) -> EitherKleisli<E, A, C>where
E: Clone + 'static,
Compose two Kleisli arrows: (f >=> g)
Auto Trait Implementations§
impl<E, A, B> Freeze for EitherKleisli<E, A, B>
impl<E, A, B> !RefUnwindSafe for EitherKleisli<E, A, B>
impl<E, A, B> !Send for EitherKleisli<E, A, B>
impl<E, A, B> !Sync for EitherKleisli<E, A, B>
impl<E, A, B> Unpin for EitherKleisli<E, A, B>
impl<E, A, B> UnsafeUnpin for EitherKleisli<E, A, B>
impl<E, A, B> !UnwindSafe for EitherKleisli<E, A, B>
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