Struct naan::impls::identity::hkt::Id

source ·
pub struct Id;
Expand description

Id HKT

Trait Implementations§

source§

impl<T> Alt<Id, T> for Id<T>

source§

fn alt(self, _: Self) -> Self

See Alt
source§

impl<T> Applicative<Id, T> for Id<T>

source§

fn pure(a: T) -> Id<T>

Lift A to F<A>
source§

impl<AB> Apply<Id, AB> for Id<AB>

source§

fn apply_with<A, B, Cloner>( self, a: <Id as HKT1>::T<A>, _: Cloner ) -> <Id as HKT1>::T<B>where AB: F1<A, Ret = B>, Cloner: for<'a> F1<&'a A, Ret = A>,

Apply the function A -> B contained in Self (F<A -> B>) to an instance of F<A> to get F<B>.
source§

fn apply<A, B>(self, a: F::T<A>) -> F::T<B>where Self: Sized, AB: F1<A, Ret = B>, A: Clone,

See [Apply.apply_with]
source§

impl<T> ApplyOnce<Id, T> for Id<T>

source§

fn apply1<A, B>(self, a: Id<A>) -> Id<B>where T: F1Once<A, Ret = B>,

source§

impl<A> Functor<Id, A> for Id<A>

source§

fn fmap<AB, B>(self, f: AB) -> <Id as HKT1>::T<B>where AB: F1<A, Ret = B>,

Use a function from A -> B to transform an F<A> to an F<B>.
source§

impl<T> FunctorOnce<Id, T> for Id<T>

source§

fn fmap1<AB, B>(self, f: AB) -> Id<B>where AB: F1Once<T, Ret = B>,

source§

impl HKT1 for Id

§

type T<A> = Id<A>

The generic type
source§

impl<A> Monad<Id, A> for Id<A>

source§

fn bind<B, AMB>(self, f: AMB) -> <Id as HKT1>::T<B>where AMB: F1<A, Ret = <Id as HKT1>::T<B>>,

See Monad
source§

fn flatten<AA>(self) -> M::T<AA>where Self: Sized, M: HKT1<T<AA> = A> + HKT1<T<<M as HKT1>::T<AA>> = Self>,

Flatten a nested Monad Read more
source§

impl<T> MonadOnce<Id, T> for Id<T>

source§

fn bind1<B, AMB>(self, f: AMB) -> Id<B>where AMB: F1Once<T, Ret = Id<B>>,

source§

fn discard<AMB, B>(self, f: AMB) -> M::T<A>where Self: Sized, B: Discard, AMB: for<'a> F1Once<&'a A, Ret = M::T<B>>, M::T<B>: MonadOnce<M, B>,

MonadOnce::bind1 that Discards the output of the function. Read more
source§

fn discard_mut<AMB, B>(self, f: AMB) -> M::T<A>where Self: Sized, B: Discard, AMB: for<'a> F1Once<&'a mut A, Ret = M::T<B>>, M::T<B>: MonadOnce<M, B>,

MonadOnce::discard with mutable access to the data Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Id

§

impl Send for Id

§

impl Sync for Id

§

impl Unpin for Id

§

impl UnwindSafe for Id

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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<F, A, TF, T> Sequence<F, A, TF> for T

source§

fn sequence<Ap>(self) -> Ap::T<F::T<A>>where Self: Sized + Traversable<F, Ap::T<A>, A, TF> + Foldable<F, Ap::T<A>>, Ap: HKT1, Ap::T<A>: Applicative<Ap, A> + ApplyOnce<Ap, A>, Ap::T<TF>: Applicative<Ap, TF> + ApplyOnce<Ap, TF>, Ap::T<F::T<A>>: Applicative<Ap, F::T<A>> + ApplyOnce<Ap, F::T<A>>, F: HKT1<T<Ap::T<A>> = Self>,

source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.