cats-effect icon indicating copy to clipboard operation
cats-effect copied to clipboard

cats.mtl.Local[IO, E] from IOLocal[E]

Open rossabaker opened this issue 2 years ago • 7 comments
trafficstars

cats.mtl.Local's semantics are a safe and useful subset of what can be done with IOLocal. This provides easy access to a Local[F, E] instance from an IOLocal[E] value.

  • core takes on a cats-mtl dependency. Note that testkit already couples these release cycles.
  • Adds IOLocal#asLocal to get a Local view of an IOLocal value
  • Adds IOLocal.local to create an IOLocal and return a local view of it, inside IO.

A similar view is already in use in otel4s.

Fixes #3385.

rossabaker avatar Feb 17 '23 19:02 rossabaker