pub enum FreerComp {
Pure(String),
Impure {
effect: String,
op: String,
arg: String,
cont: Box<dyn FnOnce(String) -> FreerComp>,
},
}Expand description
A type-erased representation of the Freer monad for string-typed operations.
FreerComp is either a pure value or an impure node holding an operation
description and a continuation.
Variants§
Pure(String)
Pure computation: just a string value.
Impure
Impure: an effect name, operation name, argument, and a continuation.
Implementations§
Source§impl FreerComp
impl FreerComp
Sourcepub fn impure(
effect: impl Into<String>,
op: impl Into<String>,
arg: impl Into<String>,
cont: impl FnOnce(String) -> FreerComp + 'static,
) -> Self
pub fn impure( effect: impl Into<String>, op: impl Into<String>, arg: impl Into<String>, cont: impl FnOnce(String) -> FreerComp + 'static, ) -> Self
Construct an impure Freer computation (one algebraic operation).
Auto Trait Implementations§
impl Freeze for FreerComp
impl !RefUnwindSafe for FreerComp
impl !Send for FreerComp
impl !Sync for FreerComp
impl Unpin for FreerComp
impl UnsafeUnpin for FreerComp
impl !UnwindSafe for FreerComp
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