Skip to main content

IdentityF

Struct IdentityF 

Source
pub struct IdentityF;
Expand description

Type constructor for the identity functor: Of<T> = T.

Trait Implementations§

Source§

impl Adjunction<IdentityF, IdentityF> for IdentityAdj

Source§

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

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

fn counit<B>(b: B) -> B
where B: 'static,

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

impl Applicative for IdentityF

Source§

fn pure<A>(a: A) -> A

Source§

impl ApplicativeSt for IdentityF

Source§

fn pure_st<A>(a: A) -> A
where A: 'static,

Source§

impl Apply for IdentityF

Source§

fn ap<A, B, F>(ff: F, fa: A) -> B
where A: Clone, F: Fn(A) -> B,

Source§

impl Chain for IdentityF

Source§

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

Source§

impl ChainSt for IdentityF

Source§

fn chain_st<A, B>(fa: A, f: impl Fn(A) -> B + 'static) -> B
where A: 'static, B: 'static,

Source§

impl Comonad for IdentityF

Source§

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

Source§

impl Extend for IdentityF

Source§

fn extend<A, B>(wa: A, f: impl Fn(&A) -> B) -> 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 Foldable for IdentityF

Source§

fn fold_right<A, B>(fa: A, init: B, f: impl Fn(A, B) -> B) -> B

Source§

fn fold_map<A, M>(fa: Self::Of<A>, f: impl Fn(A) -> M) -> M
where M: Monoid,

Source§

impl Functor for IdentityF

Source§

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

Source§

impl FunctorSt for IdentityF

Source§

fn fmap_st<A, B>(fa: A, f: impl Fn(A) -> B + 'static) -> B
where A: 'static, B: 'static,

Source§

impl HKT for IdentityF

Source§

type Of<T> = T

Source§

impl Invariant for IdentityF

Source§

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

Auto Trait Implementations§

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.
Source§

impl<F> Monad for F
where F: Applicative + Chain,