Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test() -> Maybe[int]:
return Just(1)
def test_stack_safety(self):
with recursion_limit(100):
sequence([Done(v) for v in range(500)]).run()
def test() -> List[int]:
return List(['1', '2', '3']).and_then(lambda x: List([x**2]))
def test() -> List[str]:
return List(i for i in (1, 2, 3)).and_then(lambda x: List([x**2]))
def test() -> List[int]:
return List([1])
e = e.recover(lambda _: effect.success(''))
with recursion_limit(100):
def test_stack_safety(self):
with recursion_limit(100):
cont.sequence([cont.value(v) for v in range(500)]).run(identity)
def test_identity_law(self, value):
assert Left(value).map(identity) == Left(value)
assert Right(value).map(identity) == Right(value)
def test_map_m(self):
assert map_m(Right, range(3)) == Right((0, 1, 2))
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)