Skip to main content

ReaderTF

Struct ReaderTF 

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

ReaderT monad transformer: adds environment-passing to an inner monad.

ReaderTF<E, M>::Of<A> = Box<dyn Fn(E) -> M::Of<A>>

When the inner monad is IdentityF, this is equivalent to ReaderF<E>.

Trait Implementations§

Source§

impl<E: Clone + 'static, M: ChainSt + 'static> ChainSt for ReaderTF<E, M>

Source§

fn chain_st<A: 'static, B: 'static>( fa: Box<dyn Fn(E) -> M::Of<A>>, f: impl Fn(A) -> Box<dyn Fn(E) -> M::Of<B>> + 'static, ) -> Box<dyn Fn(E) -> M::Of<B>>

Source§

impl<E: 'static, M: FunctorSt + 'static> FunctorSt for ReaderTF<E, M>

Source§

fn fmap_st<A: 'static, B: 'static>( fa: Box<dyn Fn(E) -> M::Of<A>>, f: impl Fn(A) -> B + 'static, ) -> Box<dyn Fn(E) -> M::Of<B>>

Source§

impl<E: 'static, M: HKT + 'static> HKT for ReaderTF<E, M>

Source§

type Of<A> = Box<dyn Fn(E) -> <M as HKT>::Of<A>>

Source§

impl<E: 'static, M: FunctorSt + 'static> MonadTrans<M> for ReaderTF<E, M>

Source§

fn lift<A: 'static>(ma: M::Of<A>) -> Box<dyn Fn(E) -> M::Of<A>>
where M::Of<A>: Clone,

Lift an inner monadic value into the transformer.

Auto Trait Implementations§

§

impl<E, M> Freeze for ReaderTF<E, M>

§

impl<E, M> RefUnwindSafe for ReaderTF<E, M>

§

impl<E, M> Send for ReaderTF<E, M>
where E: Send, M: Send,

§

impl<E, M> Sync for ReaderTF<E, M>
where E: Sync, M: Sync,

§

impl<E, M> Unpin for ReaderTF<E, M>
where E: Unpin, M: Unpin,

§

impl<E, M> UnsafeUnpin for ReaderTF<E, M>

§

impl<E, M> UnwindSafe for ReaderTF<E, M>
where E: 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.