empty

Function empty 

Source
pub fn empty<M: Monoid>() -> M
Expand description

The identity element.

Free function version that dispatches to the type class’ associated function.

§Type Signature

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

§Type Parameters

  • M: The type of the monoid.

§Returns

The identity element.

§Examples

use fp_library::functions::*;

let x: String = empty();
assert_eq!(x, "".to_string());