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
impl Applicative<LinkedListWitness> for LinkedListWitness
Source§fn pure<T>(value: T) -> LinkedList<T>
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>
fn apply<A, B, Func>( f_ab: LinkedList<Func>, f_a: LinkedList<A>, ) -> LinkedList<B>
Applies a list of functions to a list of values.
Source§impl Foldable<LinkedListWitness> for LinkedListWitness
impl Foldable<LinkedListWitness> for LinkedListWitness
Source§fn fold<A, B, Func>(fa: LinkedList<A>, init: B, f: Func) -> Bwhere
Func: FnMut(B, A) -> B,
fn fold<A, B, Func>(fa: LinkedList<A>, init: B, f: Func) -> Bwhere
Func: FnMut(B, A) -> B,
Folds (reduces) a LinkedList into a single value.
Source§impl Functor<LinkedListWitness> for LinkedListWitness
impl Functor<LinkedListWitness> for LinkedListWitness
Source§fn fmap<A, B, Func>(m_a: LinkedList<A>, f: Func) -> LinkedList<B>where
Func: FnMut(A) -> B,
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
impl HKT for LinkedListWitness
Source§type Type<T> = LinkedList<T>
type Type<T> = LinkedList<T>
Specifies that LinkedListWitness represents the LinkedList<T> type constructor.
Source§impl Monad<LinkedListWitness> for LinkedListWitness
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>,
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§
impl Freeze for LinkedListWitness
impl RefUnwindSafe for LinkedListWitness
impl Send for LinkedListWitness
impl Sync for LinkedListWitness
impl Unpin for LinkedListWitness
impl UnwindSafe for LinkedListWitness
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more