[][src]Struct monadic::writer::Writer

pub struct Writer<A, W = String> { /* fields omitted */ }

Methods

impl<A, W: Monoid + Clone> Writer<A, W>[src]

pub fn bind<B, F>(self, f: F) -> Writer<B, W> where
    F: Fn(A) -> Writer<B, W>,
    Self: Sized
[src]

pub fn pure(x: A) -> Self[src]

pub fn lift<B>(self, x: B) -> Writer<B, W>[src]

pub fn unwrap_pair(self) -> (A, W)[src]

pub fn unwrap(self) -> A[src]

pub fn listen(self) -> Writer<(A, W), W>[src]

pub fn listens<T, F: Fn(W) -> T>(self, f: F) -> Writer<(A, T), W>[src]

pub fn censor<F: Fn(W) -> W>(self, f: F) -> Writer<A, W>[src]

Trait Implementations

impl<A: Clone, W> IntoIterator for Writer<A, W>[src]

type Item = A

The type of the elements being iterated over.

type IntoIter = WriterIterator<A>

Which kind of iterator are we turning this into?

impl<A: Clone, W: Clone> Clone for Writer<A, W>[src]

Auto Trait Implementations

impl<A, W> Send for Writer<A, W> where
    A: Send,
    W: Send

impl<A, W> Sync for Writer<A, W> where
    A: Sync,
    W: Sync

impl<A, W> Unpin for Writer<A, W> where
    A: Unpin,
    W: Unpin

impl<A, W> UnwindSafe for Writer<A, W> where
    A: UnwindSafe,
    W: UnwindSafe

impl<A, W> RefUnwindSafe for Writer<A, W> where
    A: RefUnwindSafe,
    W: RefUnwindSafe

Blanket Implementations

impl<R> Bind for R where
    R: IntoIterator
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]