← ZIO Direct docs

Transformer

zio.direct.core.Transformer
class Transformer[F[_, _, _], F_out, S, W, MM <: MonadModel](inputQuotes: Quotes)(implicit evidence$1: Type[F], evidence$2: Type[F_out], evidence$3: Type[S], evidence$4: Type[W], evidence$5: Type[MM]) extends WithF, WithIR, WithComputeType, WithPrintIR, WithReconstructTree, WithDecomposeTree, WithInterpolator, WithZioType, WithResolver

Attributes

Source
Transformer.scala
Graph
Supertypes
trait WithResolver
trait WithZioType
trait WithPrintIR
trait WithIR
trait WithF
trait MacroBase
class Object
trait Matchable
class Any
Show all

Members list

Type members

Inherited classlikes

case class ComputeIRT(et: ZioEffectType, typeUnion: TypeUnion)

Attributes

Inherited from:
WithComputeType
Source
WithComputeType.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
protected class Decompose[F[_, _, _], S, W](monad: DirectMonad[F, S, W], et: ZioEffectType, instr: Instructions)(implicit evidence$1: Type[F], evidence$2: Type[S], evidence$3: Type[W])

Attributes

Inherited from:
WithDecomposeTree
Source
WithDecomposeTree.scala
Supertypes
class Object
trait Matchable
class Any
protected object Decompose

Attributes

Inherited from:
WithDecomposeTree
Source
WithDecomposeTree.scala
Supertypes
class Object
trait Matchable
class Any
class DirectMonad[F[_, _, _], S, W](val Success: Expr[MonadSuccess[F]], val Failure: Option[Expr[MonadFallible[F]]], val Sequence: Expr[MonadSequence[F]], val SequencePar: Expr[MonadSequenceParallel[F]], val MonadState: Option[Expr[MonadState[F, S]]], val MonadLog: Option[Expr[MonadLog[F, W]]])(implicit evidence$1: Type[F], evidence$2: Type[S], evidence$3: Type[W])

Attributes

Inherited from:
WithF
Source
WithF.scala
Supertypes
class Object
trait Matchable
class Any
object DirectMonad

Attributes

Inherited from:
WithF
Source
WithF.scala
Supertypes
class Object
trait Matchable
class Any
implicit class ExprOps(expr: Expr[_])

Attributes

Inherited from:
WithZioType
Source
WithZioType.scala
Supertypes
class Object
trait Matchable
class Any
protected object IR

Attributes

Inherited from:
WithIR
Source
WithIR.scala
Supertypes
class Object
trait Matchable
class Any
sealed protected trait IR

Attributes

Inherited from:
WithIR
Source
WithIR.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Leaf
class Monad
class Pure
trait Monadic
class And
class Block
class Fail
class FlatMap
class Foreach
class If
class Map
class Match
class Or
class Parallel
class Try
class Unsafe
class ValDef
class While
Show all
protected object IRT

Attributes

Inherited from:
WithIR
Source
WithIR.scala
Supertypes
class Object
trait Matchable
class Any
sealed protected trait IRT

Attributes

Inherited from:
WithIR
Source
WithIR.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Leaf
class Monad
class Pure
trait Monadic
class And
class Block
class Fail
class FlatMap
class Foreach
class If
class Map
class Match
class Or
class Parallel
class Try
class Unsafe
class ValDef
class While
Show all
class Interpolator

Attributes

Inherited from:
WithInterpolatorBase
Source
InterpolatorBase.scala
Supertypes
class Object
trait Matchable
class Any
object Interpolator

Attributes

Inherited from:
WithInterpolatorBase
Source
InterpolatorBase.scala
Supertypes
class Object
trait Matchable
class Any
class Invoker[F[_, _, _], S, W](zpe: ZioType, directMonad: DirectMonad[F, S, W])(implicit evidence$3: Type[F], evidence$4: Type[S], evidence$5: Type[W])

Attributes

Inherited from:
WithResolver
Source
WithResolver.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class InvokeWith
case class MonadModelData(variancesListType: macroQuotes.reflect.TypeRepr, lettersListType: macroQuotes.reflect.TypeRepr)

Attributes

Inherited from:
MacroBase
Source
WithF.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class ParallelBlockExtract(monadExpr: ZioValue, monadSymbol: macroQuotes.reflect.Symbol, tpe: macroQuotes.reflect.TypeRepr)

Attributes

Inherited from:
WithResolver
Source
WithResolver.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
protected class ReconstructTree[F[_, _, _], S, W]

Attributes

Inherited from:
WithReconstructTree
Source
WithReconstructTree.scala
Supertypes
class Object
trait Matchable
class Any
protected object ReconstructTree

Attributes

Inherited from:
WithReconstructTree
Source
WithReconstructTree.scala
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
WithIR
Source
WithIR.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class WrapUnsafes[F, S, W]
implicit class TermOps(term: macroQuotes.reflect.Term)

Attributes

Inherited from:
WithZioType
Source
WithZioType.scala
Supertypes
class Object
trait Matchable
class Any
class WrapUnsafes[F[_, _, _], S, W](monad: DirectMonad[F, S, W])(implicit evidence$1: Type[F], evidence$2: Type[S], evidence$3: Type[W]) extends StatelessTransformer

Attributes

Inherited from:
WithIR
Source
WithIR.scala
Supertypes
class Object
trait Matchable
class Any
object WrapUnsafes

Wrap the IR.Pures/IR.Maps in the body of IR.Unsafe elements with ZIO.attempt. This is largely for the sake of tries working as expected, for example. (assume all the above examples are wrapped in defer { ... }) try { 1/0 } catch { case e: DivideByZeroException => ... } Normally with zio-run this will not be caught because 1/0 will not be wrapped into a ZIO.attempt. This statement will become succeed(1/0).catchSome { case e: ... } Instead we need it to become attempt(1/0).catchSome { case e: ... } This phase will do that.

Wrap the IR.Pures/IR.Maps in the body of IR.Unsafe elements with ZIO.attempt. This is largely for the sake of tries working as expected, for example. (assume all the above examples are wrapped in defer { ... }) try { 1/0 } catch { case e: DivideByZeroException => ... } Normally with zio-run this will not be caught because 1/0 will not be wrapped into a ZIO.attempt. This statement will become succeed(1/0).catchSome { case e: ... } Instead we need it to become attempt(1/0).catchSome { case e: ... } This phase will do that.

Also in a statement like this try { val x = run(foo); 1/0 } catch { case e: ... } It will become run(foo).map(x => 1/0).catchSome { case e: ... } Instead we need it to become run(foo).flatMap(x => attempt(1/0)).catchSome { case e: ... }

Most interestingly, in a statement like this try { unsafe { (run(foo), 4/0, run(bar)) } } catch { case: e... } Normally it would turn into { collect(Chunk(foo, bar)).map(iter => { val par1 = iter.next; var par2 = iter.next; (par1, 4/0, bar) } We need it to become { collect(Chunk(foo, bar)).flatMap(iter => attempt { val par1 = iter.next; var par2 = iter.next; (par1, 4/0, bar) }

Attributes

Inherited from:
WithIR
Source
WithIR.scala
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
WithZioType
Source
WithZioType.scala
Supertypes
class Object
trait Matchable
class Any
object ZioEffectType

Attributes

Inherited from:
WithZioType
Source
WithZioType.scala
Supertypes
class Object
trait Matchable
class Any
protected case class ZioType

Attributes

Inherited from:
WithZioType
Source
WithZioType.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
protected object ZioType

------------------------------------- ZioType Constructors -----------------------------------

------------------------------------- ZioType Constructors -----------------------------------

Attributes

Inherited from:
WithZioType
Source
WithZioType.scala
Supertypes
class Object
trait Matchable
class Any
class ZioValue(val term: macroQuotes.reflect.Term, val zpe: ZioType)

Attributes

Inherited from:
WithZioType
Source
WithZioType.scala
Supertypes
class Object
trait Matchable
class Any
object ZioValue

Attributes

Inherited from:
WithZioType
Source
WithZioType.scala
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def apply[T : Type](valueRaw: Expr[T], instructions: Instructions, directMonadInput: DirectMonadInput[F, S, W]): Expr[F_out]

Attributes

Source
Transformer.scala

Inherited methods

def PrintAny(model: Any): String

Attributes

Inherited from:
WithPrintIR
Source
WithPrintIR.scala
def PrintIR(model: IRT): String

Attributes

Inherited from:
WithPrintIR
Source
WithPrintIR.scala
def PrintIR(model: IR): String

Attributes

Inherited from:
WithPrintIR
Source
WithPrintIR.scala

Attributes

Inherited from:
MacroBase
Source
WithF.scala
override def printAny(any: Any): String

Attributes

Definition Classes
Inherited from:
WithInterpolator
Source
WithInterpolator.scala

Extensions

Inherited extensions

extension (expr: Expr[_])
def asExprOfOrFail[T : Type]: Expr[T]

Attributes

Inherited from:
WithResolver
Source
WithResolver.scala
extension (term: macroQuotes.reflect.Term)
def asExprOfOrFail[T : Type]: Expr[T]

Attributes

Inherited from:
WithResolver
Source
WithResolver.scala

Implicits

Implicits

implicit val macroQuotes: Quotes

Attributes

Source
Transformer.scala

Inherited implicits

final implicit def ExprOps(expr: Expr[_]): ExprOps

Attributes

Inherited from:
WithZioType
Source
WithZioType.scala
final implicit def TermOps(term: macroQuotes.reflect.Term): TermOps

Attributes

Inherited from:
WithZioType
Source
WithZioType.scala