def test_composition_law(self, f: Unary, g: Unary, value): h = compose(f, g) assert Just(value).map(h) == Just(value).map(g).map(f) assert Nothing().map(h) == Nothing().map(g).map(f)
def test_composition_law(self, f, g, l): h = compose(f, g) assert l.map(h) == l.map(g).map(f)
def test_composition_law(self, f, g, value): h = compose(f, g) assert Done(value).map(g).map(f).run() == Done(value).map(h).run()
async def test_composition_law(self, f, g, value): h = compose(f, g) assert (await Done(value).map(g).map(f).run() ) == (await Done(value).map(h).run())
def test_composition_law(self, f, g, value, env): h = compose(f, g) assert ( effect.success(value).map(h).run(env) == effect.success(value).map(g).map(f).run(env) )
def test_composition_law(self, f: Unary, g: Unary, value): h = compose(f, g) assert Left(value).map(h) == Left(value).map(g).map(f) assert Right(value).map(h) == Right(value).map(g).map(f)