WithIR
Attributes
- Source
- WithIR.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
- Self type
Members list
Type members
Classlikes
Attributes
- Companion
- trait
- Source
- WithIR.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
IR.type
Attributes
- Companion
- object
- Source
- WithIR.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Attributes
- Companion
- trait
- Source
- WithIR.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
IRT.type
Attributes
- Companion
- object
- Source
- WithIR.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Attributes
- Source
- WithIR.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
Attributes
- Companion
- object
- Source
- WithIR.scala
- Supertypes
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
- Companion
- class
- Source
- WithIR.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
WrapUnsafes.type
Implicits
Implicits
Attributes
- Source
- WithIR.scala