pub fn empty<Brand: Monoid>() -> Brand
Expand description
Returns the identity element for the monoid.
Free function version that dispatches to the typeclass’ associated function.
§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::functions::empty;
assert_eq!(empty::<String>(), "".to_string());