Skip to main content

WriterTF

Struct WriterTF 

Source
pub struct WriterTF<W, M>(/* private fields */);
Expand description

WriterT monad transformer: adds log accumulation to an inner monad.

WriterTF<W, M>::Of<A> = M::Of<(A, W)>

The log type W must be a Monoid (for pure/lift) and a Semigroup (for chain, which combines logs). This is the strict (non-lazy) variant.

Trait Implementations§

Source§

impl<W, M> ApplicativeSt for WriterTF<W, M>
where W: Monoid + 'static, M: ApplicativeSt,

Source§

fn pure_st<A>(a: A) -> <M as HKT>::Of<(A, W)>
where A: 'static,

Source§

impl<W, M> ChainSt for WriterTF<W, M>
where W: Semigroup + Clone + 'static, M: ChainSt + FunctorSt,

Source§

fn chain_st<A, B>( fa: <M as HKT>::Of<(A, W)>, f: impl Fn(A) -> <M as HKT>::Of<(B, W)> + 'static, ) -> <M as HKT>::Of<(B, W)>
where A: 'static, B: 'static,

Source§

impl<W, M> FunctorSt for WriterTF<W, M>
where W: 'static, M: FunctorSt,

Source§

fn fmap_st<A, B>( fa: <M as HKT>::Of<(A, W)>, f: impl Fn(A) -> B + 'static, ) -> <M as HKT>::Of<(B, W)>
where A: 'static, B: 'static,

Source§

impl<W, M> HKT for WriterTF<W, M>
where W: 'static, M: HKT,

Source§

type Of<A> = <M as HKT>::Of<(A, W)>

Source§

impl<W, M> MonadTrans<M> for WriterTF<W, M>
where W: Monoid + 'static, M: FunctorSt,

Source§

fn lift<A>(ma: <M as HKT>::Of<A>) -> <M as HKT>::Of<(A, W)>
where A: 'static,

Lift an inner monadic value into the transformer.

Auto Trait Implementations§

§

impl<W, M> Freeze for WriterTF<W, M>

§

impl<W, M> RefUnwindSafe for WriterTF<W, M>

§

impl<W, M> Send for WriterTF<W, M>
where W: Send, M: Send,

§

impl<W, M> Sync for WriterTF<W, M>
where W: Sync, M: Sync,

§

impl<W, M> Unpin for WriterTF<W, M>
where W: Unpin, M: Unpin,

§

impl<W, M> UnsafeUnpin for WriterTF<W, M>

§

impl<W, M> UnwindSafe for WriterTF<W, M>
where W: UnwindSafe, M: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.