pub fn append<S: Semigroup>(a: S, b: S) -> SExpand description
The result of combining the two values using the semigroup operation.
Free function version that dispatches to the type class’ associated function.
§Type Signature
forall a. Semigroup a => (a, a) -> a
§Type Parameters
S: The type of the semigroup.
§Parameters
a: The first value.b: The second value.
§Returns
The combined value.
§Examples
use fp_library::classes::semigroup::append;
use fp_library::types::string; // Import Semigroup impl for String
let x = "Hello, ".to_string();
let y = "World!".to_string();
let z = append(x, y);
assert_eq!(z, "Hello, World!".to_string());