Skip to content

Instantly share code, notes, and snippets.

@qingwei91
Created December 20, 2019 14:29
Show Gist options
  • Save qingwei91/e932b737f23be85f6a4537073dad0dc6 to your computer and use it in GitHub Desktop.
Save qingwei91/e932b737f23be85f6a4537073dad0dc6 to your computer and use it in GitHub Desktop.
// create non-terminating loop
val cancellable = cancellableLoop[IO, Int, Int](i => {println("a step");Left(i)})(0)
val fiber = cancellable.start.unsafeRunSync
fiber.cancel.unsafeRunSync
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment