Skip to main content

Alt

Trait Alt 

Source
pub trait Alt: Functor {
    // Required method
    fn alt<A>(fa1: Self::Of<A>, fa2: Self::Of<A>) -> Self::Of<A>;
}
Expand description

Alt: a Functor with an associative choice operation.

Laws:

  • Associativity: alt(alt(a, b), c) == alt(a, alt(b, c))
  • Distributivity: fmap(f, alt(a, b)) == alt(fmap(f, a), fmap(f, b))

Required Methods§

Source

fn alt<A>(fa1: Self::Of<A>, fa2: Self::Of<A>) -> Self::Of<A>

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl Alt for NonEmptyVecF

Available on crate features alloc or std only.
Source§

impl Alt for OptionF

Source§

impl Alt for VecF

Available on crate features alloc or std only.
Source§

impl<E> Alt for ResultF<E>