LinkedListWitness

Struct LinkedListWitness 

Source
pub struct LinkedListWitness;
Expand description

Re-exports LinkedListWitness, the HKT witness for LinkedList<T>. LinkedListWitness is a zero-sized type that acts as a Higher-Kinded Type (HKT) witness for the LinkedList<T> type constructor. It allows LinkedList to be used with generic functional programming traits like Functor, Applicative, Foldable, and Monad.

Trait Implementations§

Source§

impl Applicative<LinkedListWitness> for LinkedListWitness

Source§

fn pure<T>(value: T) -> LinkedList<T>

Lifts a pure value into a LinkedList containing only that value.

Source§

fn apply<A, B, Func>( f_ab: LinkedList<Func>, f_a: LinkedList<A>, ) -> LinkedList<B>
where Func: FnMut(A) -> B, A: Clone,

Applies a list of functions to a list of values.

Source§

impl Foldable<LinkedListWitness> for LinkedListWitness

Source§

fn fold<A, B, Func>(fa: LinkedList<A>, init: B, f: Func) -> B
where Func: FnMut(B, A) -> B,

Folds (reduces) a LinkedList into a single value.

Source§

impl Functor<LinkedListWitness> for LinkedListWitness

Source§

fn fmap<A, B, Func>(m_a: LinkedList<A>, f: Func) -> LinkedList<B>
where Func: FnMut(A) -> B,

Implements the fmap operation for LinkedList<T>.

Source§

impl HKT for LinkedListWitness

Source§

type Type<T> = LinkedList<T>

Specifies that LinkedListWitness represents the LinkedList<T> type constructor.

Source§

impl Monad<LinkedListWitness> for LinkedListWitness

Source§

fn bind<A, B, Func>(m_a: LinkedList<A>, f: Func) -> LinkedList<B>
where Func: FnMut(A) -> LinkedList<B>,

Implements the bind (or flat_map) operation for LinkedList<T>.

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.