tofu.syntax.scoped.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tofu-core-ce3_2.12 Show documentation
Show all versions of tofu-core-ce3_2.12 Show documentation
Opinionated set of tools for functional programming in Scala
package tofu
package syntax
import cats.FlatMap
import tofu.interop.Blocker
object scoped extends ScopedSyntax {
def withBlocker[F[_]: BlockExec: FlatMap, A](f: Blocker[F] => F[A]): F[A] =
withScopedEc[Scoped.Blocking](ec => f(Blocker(ec)))
}