korolev.zio

package korolev.zio

Members list

Concise view

Type members

Classlikes

class ZioEffect[R, E](rts: Runtime[R], liftError: Throwable => E, unliftError: E => Throwable) extends Effect[[_] =>> ZIO[R, E, _$1]]

Attributes

Graph
Supertypes
trait Effect[[_] =>> ZIO[R, E, _$1]]
class Object
trait Matchable
class Any

Value members

Concrete methods

def taskEffectInstance[R](runtime: Runtime[R]): Effect[Task]

Provides Effect instance for ZIO[Any, Throwable, *]. Use this method if your app uses Throwable to express errors.

Provides Effect instance for ZIO[Any, Throwable, *]. Use this method if your app uses Throwable to express errors.

Attributes

final def zioEffectInstance[R, E](runtime: Runtime[R])(liftError: Throwable => E)(unliftError: E => Throwable): Effect[[_] =>> ZIO[R, E, _$1]]

Provides Effect instance for ZIO with arbitrary runtime and error types. Korolev uses Throwable inside itself. That means if you want to work with your own E, you should provide functions to convert Throwable to E and vice versa.

Provides Effect instance for ZIO with arbitrary runtime and error types. Korolev uses Throwable inside itself. That means if you want to work with your own E, you should provide functions to convert Throwable to E and vice versa.

 sealed trait MyError
 object MyError {
   case class UserNotFound(id: Long) extends MyError
   case object DoNotLikeIt extends MyError
   case class Unexpected(e: Throwable) extends MyError
 }
 case class MyErrorException(error: MyError) extends Throwable

 val runtime = new DefaultRuntime {}
 implicit val zioEffect = korolev.zio.zioEffectInstance(runtime)(MyError.Unexpected)(MyErrorException)

 val ctx = Context[IO[MyError, *], MyState, Any]

Attributes