pub enum Program<'a, I: Instr, A> {
Pure(Box<A>),
Then(Box<I>, Kleisli<'a, I, I::Return, A>),
}
Expand description
Represents a program, i.e. a sequence of instructions.
- The instructions are given by the type
I
. A
is the return type of the program.
Variants§
Pure(Box<A>)
The case Pure(a)
means that the program contains no instructions and just returns the result a
.
Then(Box<I>, Kleisli<'a, I, I::Return, A>)
The case Then(instr, k)
means that the first instruction is instr
and the remaining program is given by the kleisli arrow k
.
Implementations§
Source§impl<'a, I: 'a + Instr, A> Program<'a, I, A>
impl<'a, I: 'a + Instr, A> Program<'a, I, A>
Trait Implementations§
Auto Trait Implementations§
impl<'a, I, A> Freeze for Program<'a, I, A>
impl<'a, I, A> !RefUnwindSafe for Program<'a, I, A>
impl<'a, I, A> !Send for Program<'a, I, A>
impl<'a, I, A> !Sync for Program<'a, I, A>
impl<'a, I, A> Unpin for Program<'a, I, A>
impl<'a, I, A> !UnwindSafe for Program<'a, I, 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