def test_mplus_with_nothing_and_just(self): self.givenMonoids(Nothing, First(Just(1))) self.ensure_mconcat_equals(First(Just(1)))
def test_mplus_with_two_just_values(self): self.givenMonoids(First(Just(1)), First(Just(2))) self.ensure_mconcat_equals(First(Just(1)))
def test_left_identity(self): self.givenMonoid(First(Just(9))) self.ensure_zero_plus_monoid_equals(First(Just(9)))
def test_associativity(self): self.givenMonoids(First(Just(1)), First(Just(2)), First(Just(3))) self.ensure_associativity()
def test_mzero(self): self.givenMonoid(First) self.get_mzero() self.ensure_mzero_is(First(Nothing))