pub enum FreeInner<F, A>where
F: Functor + 'static,
A: 'static,{
Pure(A),
Wrap(<F as Kind_cdc7cd43dac7585f>::Of<'static, Free<F, A>>),
Bind {
head: Box<Free<F, TypeErasedValue>>,
continuations: CatList<Continuation<F>>,
_marker: PhantomData<A>,
},
}Expand description
Variants§
Pure(A)
A pure value.
This variant represents a computation that has finished and produced a value.
Wrap(<F as Kind_cdc7cd43dac7585f>::Of<'static, Free<F, A>>)
A suspended computation.
This variant represents a computation that is suspended in the functor F.
The functor contains the next step of the computation.
Bind
A bind operation.
This variant represents a computation followed by a sequence of continuations.
It uses a CatList to store continuations, ensuring O(1) append complexity
for left-associated binds.
Fields
§
head: Box<Free<F, TypeErasedValue>>The initial computation.
§
continuations: CatList<Continuation<F>>The list of continuations to apply to the result of head.
§
_marker: PhantomData<A>Phantom data for type parameter A.
Auto Trait Implementations§
impl<F, A> Freeze for FreeInner<F, A>
impl<F, A> !RefUnwindSafe for FreeInner<F, A>
impl<F, A> !Send for FreeInner<F, A>
impl<F, A> !Sync for FreeInner<F, A>
impl<F, A> Unpin for FreeInner<F, A>
impl<F, A> !UnwindSafe for FreeInner<F, 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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more