typosaurus 0.2.0

Heterogenous lists and other type-level tomfoolery
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use super::semigroup::Semigroup;

pub trait Monoid<T, U>: Mempty + Semigroup<T, U> {
    type Mempty;
    type Mappend;
}
impl<T, U, X> Monoid<T, U> for X
where
    X: Mempty + Semigroup<T, U>,
{
    type Mempty = <X as Mempty>::Out;
    type Mappend = <X as Semigroup<T, U>>::Mappend;
}

pub trait Mempty {
    type Out;
}