pub struct Kleisli<'a, I: Instr<Return = A>, A, B> { /* private fields */ }
Expand description
The Kleisli arrow from A
to Program<I, B>
.
Implementations§
Source§impl<'a, I: 'a + Instr<Return = A>, A, B> Kleisli<'a, I, A, B>
impl<'a, I: 'a + Instr<Return = A>, A, B> Kleisli<'a, I, A, B>
Sourcepub fn append<F, C>(self, f: F) -> Kleisli<'a, I, A, C>
pub fn append<F, C>(self, f: F) -> Kleisli<'a, I, A, C>
Appends the given function to the tail of the arrow. This corresponds to closure composition at the codomain (post-composition).
§Example
use operational::{Kleisli, point};
use operational::instr::identity;
let k = Kleisli::new().append(|x| point(x + 1));
assert_eq!(k.run(42), identity(43));
Auto Trait Implementations§
impl<'a, I, A, B> Freeze for Kleisli<'a, I, A, B>
impl<'a, I, A, B> !RefUnwindSafe for Kleisli<'a, I, A, B>
impl<'a, I, A, B> !Send for Kleisli<'a, I, A, B>
impl<'a, I, A, B> !Sync for Kleisli<'a, I, A, B>
impl<'a, I, A, B> Unpin for Kleisli<'a, I, A, B>
impl<'a, I, A, B> !UnwindSafe for Kleisli<'a, I, 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