A sumptuous Scalafix smorgasbord.
You can add fixins to your project by adding the following line to your build.sbt:
ThisBuild / scalafixDependencies += "io.github.kitlangton" %% "fixins" % "0.0.4"Then you can add the rules to your .scalafix.conf:
rules = [
  SimplifyZIOTypes
]sbt 'scalafix dependency:[email protected]::fixins:0.0.4'This rule simplifies ZIO types by replacing ZIO[R, E, A] and ZLayer[R, E, A] with their more specific type aliases
whenever possible.
// ZIO Transformations
ZIO[Any, Throwable, Int] => Task[Int]
ZIO[Any, Nothing, Int] => UIO[Int]
ZIO[R, Throwable, Int] => RIO[R, Int]
ZIO[R, Nothing, Int] => URIO[R, Int]
// ZLayer Transformations
ZLayer[Any, Throwable, Int] => TaskLayer[Int]
ZLayer[Any, Nothing, Int] => ULayer[Int]
ZLayer[R, Throwable, Int] => RLayer[R, Int]
ZLayer[R, Nothing, Int] => URLayer[R, Int]