Skip to main content

Plus

Trait Plus 

Source
pub trait Plus: Alt {
    // Required method
    fn zero<A>() -> Self::Of<A>;
}
Expand description

Plus: an Alt with a zero/empty element.

Laws:

  • Left identity: alt(zero(), a) == a
  • Right identity: alt(a, zero()) == a
  • Annihilation: fmap(f, zero()) == zero()

Required Methods§

Source

fn zero<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 Plus for OptionF

Source§

impl Plus for VecF

Available on crate features alloc or std only.