Example #1
0
 def suspend_map(self) -> None:
     t = IO.suspend(IO.now, 5) / (_ + 1)
     target = 'Suspend(Pure(5).map(lambda a: (lambda b: a + b)(1)))'
     str(t.step()).should.equal(target)
Example #2
0
 def suspend(self) -> None:
     v = 13
     w = 29
     f = lambda a: IO.now(a + v)
     t = IO.suspend(f, w)
     t.run().should.equal(v + w)
Example #3
0
 def suspend_flat_map(self) -> None:
     t = IO.suspend(IO.now, 5) // IO.now
     target = 'BindSuspend(now(5).flat_map(now))'
     str(t).should.equal(target)