Skip to main content

Chain

Trait Chain 

Source
pub trait Chain: Apply {
    // Required method
    fn chain<A, B>(fa: Self::Of<A>, f: impl Fn(A) -> Self::Of<B>) -> Self::Of<B>;
}
Expand description

Chain (FlatMap): an Apply with monadic bind.

Laws:

  • Associativity: chain(chain(m, f), g) == chain(m, |x| chain(f(x), g))

Required Methods§

Source

fn chain<A, B>(fa: Self::Of<A>, f: impl Fn(A) -> Self::Of<B>) -> Self::Of<B>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Chain for IdentityF

Source§

impl Chain for NonEmptyVecF

Available on crate features alloc or std only.
Source§

impl Chain for OptionF

Source§

impl Chain for VecF

Available on crate features alloc or std only.
Source§

impl<E> Chain for ResultF<E>