-
Added
FiberRef
, a version ofFiberLocal
that's inherited by child fibers on forks and joins (#665) (#618)- Added
inheritFiberRefs
- Added
-
ZStream
now tracks finalization scopes as part of the stream computations. This means that resources are acquired and released more precisely as part of the stream, including across concurrency combinators such asbuffer
,zipWith
andmerge
. (#906)ZStream
usesZManaged
as the return type for stream folds- Several concurrency combinators were added:
ZStream#flatMapPar
,ZStream.flattenPar
andZStream.mergeAll
.
-
Added ZIO Tracing for the JVM -
Cause
now includes aZTrace
with the fiber's monadic stack trace, execution trace and traces of parent fibers at time of failure. (#849)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class X() | |
sealed trait Unrelated { def x: Int } | |
object App extends App { | |
def getX(xs: List[X]): List[Int] = { | |
xs.collect { | |
case u: Unrelated => u.x | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object MyTest extends Test { | |
val suite = | |
"MySuite" | |
> "should do x" { | |
assert(2 + 2 == 4) | |
} | |
> "should do y" { | |
assert(2 + 2 == 8) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package example | |
import example.Has.Has0 | |
import example.Eq.{GEQ, Y} | |
import example.Vessel.{FlipAp, FlipAp0, VSum} | |
import scala.language.implicitConversions | |
final case class LS[F[_]](l: List[F[String]]) | |
final case class LI[F[_]](l: List[F[Int]]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait TRIO[F[-_, +_, +_]] { | |
def pure[A](a: A): F[Any, Nothing, A] | |
def fail[E](e: E): F[Any, E, Nothing] | |
def flatMap[R1, E1, A, R2 <: R1, E2 >: E1, B](fa: F[R1, E1, A])(fab: A => F[R2, E2, B]): F[R2, E2, B] | |
def catchAll[R1, E1, A, R2 <: R1, E2, A2 >: A](fa: F[R1, E1, A])(h: E1 => F[R2, E2, A2]): F[R2, E2, A2] | |
def bracket[R, E, A, B](acquire: F[R, E, A], release: A => F[R, Nothing, Unit], use: A => F[R, E, B]): F[R, E, B] | |
} | |
object TRIO { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.pshirshov.izumi | |
import com.github.pshirshov.izumi.logstage.api.logger.LogRouter | |
import com.github.pshirshov.izumi.logstage.api.{IzLogger, Log} | |
object PerfTest { | |
final val acceptingNullRouter = new LogRouter { | |
override def acceptable(id: Log.LoggerId, messageLevel: Log.Level): Boolean = true | |
override protected def doLog(entry: Log.Entry): Unit = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package quantified | |
import cats.Monad | |
import scala.language.implicitConversions | |
/** | |
* C[_] constraint applied to type F[_, _] quantified in first parameter, i.e. | |
* | |
* {{{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import distage._ | |
import distage.config._ | |
import com.typesafe.config._ | |
import scala.concurrent.{Await, Future} | |
import scala.concurrent.duration.Duration | |
import scala.concurrent.ExecutionContext.global | |
case class DbConf() | |
case class MsgQueueConf() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.kaishh.day | |
import arrow.* | |
import arrow.core.* | |
import arrow.data.* | |
import arrow.syntax.function.* | |
import arrow.instances.* | |
import arrow.typeclasses.* | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cats._ | |
import cats.implicits._ | |
trait MonadRandom[F[_]] { | |
def getRandom: F[Int] | |
} | |
final case class DummyRandom[A](a: A) | |
final case class RealRandom[A](a: A) |
NewerOlder