Trait frunk::monoid::Monoid

source ·
pub trait Monoid: Semigroup {
    // Required method
    fn empty() -> Self;
}
Expand description

A Monoid is a Semigroup that has an empty/ zero value

Required Methods§

source

fn empty() -> Self

For a given Monoid, returns its empty/zero value

Examples
use frunk::Monoid;

assert_eq!(<i16 as Monoid>::empty(), 0);
Run

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Monoid for f32

source§

fn empty() -> Self

source§

impl Monoid for f64

source§

fn empty() -> Self

source§

impl Monoid for i8

source§

fn empty() -> Self

source§

impl Monoid for i16

source§

fn empty() -> Self

source§

impl Monoid for i32

source§

fn empty() -> Self

source§

impl Monoid for i64

source§

fn empty() -> Self

source§

impl Monoid for isize

source§

fn empty() -> Self

source§

impl Monoid for u8

source§

fn empty() -> Self

source§

impl Monoid for u16

source§

fn empty() -> Self

source§

impl Monoid for u32

source§

fn empty() -> Self

source§

impl Monoid for u64

source§

fn empty() -> Self

source§

impl Monoid for usize

source§

fn empty() -> Self

source§

impl Monoid for String

source§

fn empty() -> Self

source§

impl<A: Monoid> Monoid for (A,)

source§

fn empty() -> Self

source§

impl<A: Monoid, B: Monoid> Monoid for (A, B)

source§

fn empty() -> Self

source§

impl<A: Monoid, B: Monoid, C: Monoid> Monoid for (A, B, C)

source§

fn empty() -> Self

source§

impl<A: Monoid, B: Monoid, C: Monoid, D: Monoid> Monoid for (A, B, C, D)

source§

fn empty() -> Self

source§

impl<A: Monoid, B: Monoid, C: Monoid, D: Monoid, E: Monoid> Monoid for (A, B, C, D, E)

source§

fn empty() -> Self

source§

impl<A: Monoid, B: Monoid, C: Monoid, D: Monoid, E: Monoid, F: Monoid> Monoid for (A, B, C, D, E, F)

source§

fn empty() -> Self

source§

impl<A: Monoid, B: Monoid, C: Monoid, D: Monoid, E: Monoid, F: Monoid, G: Monoid> Monoid for (A, B, C, D, E, F, G)

source§

fn empty() -> Self

source§

impl<A: Monoid, B: Monoid, C: Monoid, D: Monoid, E: Monoid, F: Monoid, G: Monoid, H: Monoid> Monoid for (A, B, C, D, E, F, G, H)

source§

fn empty() -> Self

source§

impl<A: Monoid, B: Monoid, C: Monoid, D: Monoid, E: Monoid, F: Monoid, G: Monoid, H: Monoid, I: Monoid> Monoid for (A, B, C, D, E, F, G, H, I)

source§

fn empty() -> Self

source§

impl<A: Monoid, B: Monoid, C: Monoid, D: Monoid, E: Monoid, F: Monoid, G: Monoid, H: Monoid, I: Monoid, J: Monoid> Monoid for (A, B, C, D, E, F, G, H, I, J)

source§

fn empty() -> Self

source§

impl<A: Monoid, B: Monoid, C: Monoid, D: Monoid, E: Monoid, F: Monoid, G: Monoid, H: Monoid, I: Monoid, J: Monoid, K: Monoid> Monoid for (A, B, C, D, E, F, G, H, I, J, K)

source§

fn empty() -> Self

source§

impl<A: Monoid, B: Monoid, C: Monoid, D: Monoid, E: Monoid, F: Monoid, G: Monoid, H: Monoid, I: Monoid, J: Monoid, K: Monoid, L: Monoid> Monoid for (A, B, C, D, E, F, G, H, I, J, K, L)

source§

fn empty() -> Self

source§

impl<A: Monoid, B: Monoid, C: Monoid, D: Monoid, E: Monoid, F: Monoid, G: Monoid, H: Monoid, I: Monoid, J: Monoid, K: Monoid, L: Monoid, M: Monoid> Monoid for (A, B, C, D, E, F, G, H, I, J, K, L, M)

source§

fn empty() -> Self

source§

impl<A: Monoid, B: Monoid, C: Monoid, D: Monoid, E: Monoid, F: Monoid, G: Monoid, H: Monoid, I: Monoid, J: Monoid, K: Monoid, L: Monoid, M: Monoid, N: Monoid> Monoid for (A, B, C, D, E, F, G, H, I, J, K, L, M, N)

source§

fn empty() -> Self

source§

impl<A: Monoid, B: Monoid, C: Monoid, D: Monoid, E: Monoid, F: Monoid, G: Monoid, H: Monoid, I: Monoid, J: Monoid, K: Monoid, L: Monoid, M: Monoid, N: Monoid, O: Monoid> Monoid for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)

source§

fn empty() -> Self

source§

impl<A: Monoid, B: Monoid, C: Monoid, D: Monoid, E: Monoid, F: Monoid, G: Monoid, H: Monoid, I: Monoid, J: Monoid, K: Monoid, L: Monoid, M: Monoid, N: Monoid, O: Monoid, P: Monoid> Monoid for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)

source§

fn empty() -> Self

source§

impl<A: Monoid, B: Monoid, C: Monoid, D: Monoid, E: Monoid, F: Monoid, G: Monoid, H: Monoid, I: Monoid, J: Monoid, K: Monoid, L: Monoid, M: Monoid, N: Monoid, O: Monoid, P: Monoid, Q: Monoid> Monoid for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)

source§

fn empty() -> Self

source§

impl<A: Monoid, B: Monoid, C: Monoid, D: Monoid, E: Monoid, F: Monoid, G: Monoid, H: Monoid, I: Monoid, J: Monoid, K: Monoid, L: Monoid, M: Monoid, N: Monoid, O: Monoid, P: Monoid, Q: Monoid, R: Monoid> Monoid for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R)

source§

fn empty() -> Self

source§

impl<A: Monoid, B: Monoid, C: Monoid, D: Monoid, E: Monoid, F: Monoid, G: Monoid, H: Monoid, I: Monoid, J: Monoid, K: Monoid, L: Monoid, M: Monoid, N: Monoid, O: Monoid, P: Monoid, Q: Monoid, R: Monoid, S: Monoid> Monoid for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S)

source§

fn empty() -> Self

source§

impl<A: Monoid, B: Monoid, C: Monoid, D: Monoid, E: Monoid, F: Monoid, G: Monoid, H: Monoid, I: Monoid, J: Monoid, K: Monoid, L: Monoid, M: Monoid, N: Monoid, O: Monoid, P: Monoid, Q: Monoid, R: Monoid, S: Monoid, T: Monoid> Monoid for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T)

source§

fn empty() -> Self

source§

impl<A: Monoid, B: Monoid, C: Monoid, D: Monoid, E: Monoid, F: Monoid, G: Monoid, H: Monoid, I: Monoid, J: Monoid, K: Monoid, L: Monoid, M: Monoid, N: Monoid, O: Monoid, P: Monoid, Q: Monoid, R: Monoid, S: Monoid, T: Monoid, U: Monoid> Monoid for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U)

source§

fn empty() -> Self

source§

impl<K, V> Monoid for HashMap<K, V>where K: Eq + Hash + Clone, V: Semigroup + Clone,

source§

fn empty() -> Self

source§

impl<T> Monoid for Option<T>where T: Semigroup + Clone,

source§

fn empty() -> Self

source§

impl<T> Monoid for Vec<T>where T: Clone,

source§

fn empty() -> Self

source§

impl<T> Monoid for HashSet<T>where T: Hash + Eq + Clone,

source§

fn empty() -> Self

Implementors§