Skip to main content

Module additive

Module additive 

Source
Expand description

A newtype wrapper whose Semigroup and Monoid instances use addition from Semiring.

§Examples

use fp_library::{
	functions::*,
	types::Additive,
};

let x = Additive(3i32);
let y = Additive(4i32);
assert_eq!(append(x, y), Additive(7));
assert_eq!(empty::<Additive<i32>>(), Additive(0));

Structs§

Additive
A newtype wrapper whose Semigroup instance uses Semiring::add.