pub trait AndThen<B>: Higher {
    // Required method
    fn and_then<F>(self, f: F) -> Self::Target<B>
       where F: FnMut(Self::Param) -> Self::Target<B>;
}
Expand description

Gives access to the and_then method. This trait is needed to implement ApN. The motivation for not using FlatMap is that there are situations where and_then can be implemented but not FlatMap::flat_map, e.g. Validated.

Required Methods§

source

fn and_then<F>(self, f: F) -> Self::Target<B>where F: FnMut(Self::Param) -> Self::Target<B>,

Maps a function over a value in the context and flattens the resulting nested context.

Implementations on Foreign Types§

source§

impl<B, T> AndThen<B> for Box<T>

source§

fn and_then<F>(self, f: F) -> Self::Target<B>where F: FnMut(Self::Param) -> Self::Target<B>,

source§

impl<A, B, K: Hash + Eq> AndThen<B> for HashMap<K, A>

source§

fn and_then<F>(self, f: F) -> HashMap<K, B>where F: FnMut(A) -> HashMap<K, B>,

source§

impl<B, T> AndThen<B> for Option<T>

source§

fn and_then<F>(self, f: F) -> Self::Target<B>where F: FnMut(Self::Param) -> Self::Target<B>,

source§

impl<B, T, E> AndThen<B> for Result<T, E>

source§

fn and_then<F>(self, f: F) -> Self::Target<B>where F: FnMut(Self::Param) -> Self::Target<B>,

source§

impl<B, T> AndThen<B> for LinkedList<T>

source§

fn and_then<F>(self, f: F) -> Self::Target<B>where F: FnMut(Self::Param) -> Self::Target<B>,

source§

impl<B: Hash + Eq, T> AndThen<B> for HashSet<T>

source§

fn and_then<F>(self, f: F) -> Self::Target<B>where F: FnMut(Self::Param) -> Self::Target<B>,

source§

impl<B: Ord, T> AndThen<B> for BTreeSet<T>

source§

fn and_then<F>(self, f: F) -> Self::Target<B>where F: FnMut(Self::Param) -> Self::Target<B>,

source§

impl<B: Ord, T> AndThen<B> for BinaryHeap<T>

source§

fn and_then<F>(self, f: F) -> Self::Target<B>where F: FnMut(Self::Param) -> Self::Target<B>,

source§

impl<A, B> AndThen<B> for PhantomData<A>

source§

fn and_then<F>(self, _f: F) -> PhantomData<B>where F: FnMut(A) -> PhantomData<B>,

source§

impl<B, T> AndThen<B> for Vec<T>

source§

fn and_then<F>(self, f: F) -> Self::Target<B>where F: FnMut(Self::Param) -> Self::Target<B>,

source§

impl<B, T> AndThen<B> for VecDeque<T>

source§

fn and_then<F>(self, f: F) -> Self::Target<B>where F: FnMut(Self::Param) -> Self::Target<B>,

Implementors§

source§

impl<A, B, E> AndThen<B> for Validated<A, E>

source§

impl<B, T> AndThen<B> for NEVec<T>