Function empty

Source
pub fn empty<Brand>() -> Apply<Brand, ()>
where Brand: Monoid,
Expand description

Returns the identity element for the monoid.

Free function version that dispatches to the typeclass method.

§Type Signature

forall a. Monoid a => () -> a

§Returns

The identity element which, when combined with any other element using the semigroup operation, leaves the other element unchanged.

§Examples

use fp_library::{brands::StringBrand, functions::empty};

assert_eq!(empty::<StringBrand>(), "".to_string());