Skip to main content

EnvF

Struct EnvF 

Source
pub struct EnvF<E>(/* private fields */);
Expand description

Type constructor for the Env comonad: Of<T> = (E, T).

Trait Implementations§

Source§

impl<E> Adjunction<EnvF<E>, ReaderF<E>> for CurryAdj<E>
where E: Clone + 'static,

Available on crate features alloc or std only.
Source§

fn unit<A>(a: A) -> Box<dyn Fn(E) -> (E, A)>
where A: Clone + 'static,

unit: A -> U(F(A))
Source§

fn counit<B>(fub: (E, Box<dyn Fn(E) -> B>)) -> B
where B: 'static,

counit: F(U(B)) -> B
Source§

impl<E> Comonad for EnvF<E>

Source§

fn extract<A>(wa: &(E, A)) -> A
where A: Clone,

Source§

impl<E> ComonadEnv<E> for EnvF<E>
where E: Clone,

Source§

fn ask<A>(wa: &(E, A)) -> E

Source§

fn local<A>(wa: (E, A), f: impl Fn(E) -> E) -> (E, A)

Source§

impl<E> Extend for EnvF<E>

Source§

fn extend<A, B>(wa: (E, A), f: impl Fn(&(E, A)) -> B) -> (E, B)
where A: Clone,

Source§

fn duplicate<A>(wa: Self::Of<A>) -> Self::Of<Self::Of<A>>
where A: Clone, Self::Of<A>: Clone,

Source§

impl<E> Functor for EnvF<E>

Source§

fn fmap<A, B>(fa: (E, A), f: impl Fn(A) -> B) -> (E, B)

Source§

impl<E> HKT for EnvF<E>

Source§

type Of<T> = (E, T)

Source§

impl<E> Invariant for EnvF<E>

Source§

fn invmap<A, B>(fa: (E, A), f: impl Fn(A) -> B, _g: impl Fn(B) -> A) -> (E, B)

Auto Trait Implementations§

§

impl<E> Freeze for EnvF<E>

§

impl<E> RefUnwindSafe for EnvF<E>
where E: RefUnwindSafe,

§

impl<E> Send for EnvF<E>
where E: Send,

§

impl<E> Sync for EnvF<E>
where E: Sync,

§

impl<E> Unpin for EnvF<E>
where E: Unpin,

§

impl<E> UnsafeUnpin for EnvF<E>

§

impl<E> UnwindSafe for EnvF<E>
where E: 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.