pub struct StateTF<S, M>(/* private fields */);Expand description
StateT monad transformer: adds mutable state to an inner monad.
StateTF<S, M>::Of<A> = Box<dyn Fn(S) -> M::Of<(S, A)>>
Unlike ReaderT, the state is threaded (modified) through computations.
When the inner monad is IdentityF, this is equivalent to the State monad
from karpal-core’s adjunction module.
Trait Implementations§
Auto Trait Implementations§
impl<S, M> Freeze for StateTF<S, M>
impl<S, M> RefUnwindSafe for StateTF<S, M>where
S: RefUnwindSafe,
M: RefUnwindSafe,
impl<S, M> Send for StateTF<S, M>
impl<S, M> Sync for StateTF<S, M>
impl<S, M> Unpin for StateTF<S, M>
impl<S, M> UnsafeUnpin for StateTF<S, M>
impl<S, M> UnwindSafe for StateTF<S, M>where
S: UnwindSafe,
M: UnwindSafe,
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