Exemple #1
0
def test_monoid_law_right_identity(m):
    # a + mempty = a
    assert tc.mappend(m, tc.mempty(m)) == m
Exemple #2
0
def test_monoid_law_left_identity(m):
    # mempty + a = a
    assert tc.mappend(tc.mempty(m), m) == m
Exemple #3
0
def test_monoid_law_right_identity(monoids):
    # a + mempty = a
    monoid = monoids[0]
    assert tc.mappend(monoid, tc.mempty(monoid)) == monoid
Exemple #4
0
def test_monoid_law_left_identity(monoids):
    # mempty + a = a
    monoid = monoids[0]
    assert tc.mappend(tc.mempty(monoid), monoid) == monoid
def test_monoid_law_left_identity(monoids):
    # mempty + a = a
    monoid = monoids[0]
    assert tc.mappend(tc.mempty(monoid), monoid) == monoid
def test_monoid_law_right_identity(monoids):
    # a + mempty = a
    monoid = monoids[0]
    assert tc.mappend(monoid, tc.mempty(monoid)) == monoid