Skip to content

Commit

Permalink
Merge branch 'series/2.x' into update/scala-compiler-2.13.13
Browse files Browse the repository at this point in the history
  • Loading branch information
guizmaii authored Apr 13, 2024
2 parents 491ce29 + 8cdeb94 commit b2b68de
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.7.17"
version = "3.8.1"
maxColumn = 120
align.preset = most
continuationIndent.defnSite = 2
Expand Down
8 changes: 5 additions & 3 deletions core/shared/src/main/scala/zio/prelude/fx/ZPure.scala
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ sealed trait ZPure[+W, -S1, +S2, -R, +E, +A] { self =>
final def none[B](implicit ev: A <:< Option[B]): ZPure[W, S1, S2, R, Option[E], Unit] =
self.foldM(
e => ZPure.fail(Some(e)),
a => a.fold[ZPure[W, S2, S2, R, Option[E], Unit]](ZPure.succeed(()))(_ => ZPure.fail(None))
a => a.fold[ZPure[W, S2, S2, R, Option[E], Unit]](ZPure.unit)(_ => ZPure.fail(None))
)

/**
Expand Down Expand Up @@ -972,6 +972,8 @@ sealed trait ZPure[+W, -S1, +S2, -R, +E, +A] { self =>
}

object ZPure {
private val succeedUnit: ZPure[Nothing, Any, Nothing, Any, Nothing, Unit] = Succeed(())
private val succeedNone: ZPure[Nothing, Any, Nothing, Any, Nothing, Option[Nothing]] = Succeed(None)

/**
* Constructs a computation, catching any `Throwable` that is thrown.
Expand Down Expand Up @@ -1164,7 +1166,7 @@ object ZPure {
* Constructs a computation that succeeds with the `None` value.
*/
def none[S]: ZPure[Nothing, S, S, Any, Nothing, Option[Nothing]] =
succeed(None)
succeedNone

/**
* Accesses the specified service in the environment of the computation.
Expand Down Expand Up @@ -1209,7 +1211,7 @@ object ZPure {
* state through unchanged.
*/
def unit[S]: ZPure[Nothing, S, S, Any, Nothing, Unit] =
succeed(())
succeedUnit

/**
* The moral equivalent of `if (!p) exp`
Expand Down
2 changes: 1 addition & 1 deletion project/BuildHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import sbtcrossproject.CrossPlugin.autoImport.*
import scalafix.sbt.ScalafixPlugin.autoImport.*

object BuildHelper {
val Scala212: String = "2.12.18"
val Scala212: String = "2.12.19"
val Scala213: String = "2.13.13"
val Scala3: String = "3.3.3"

Expand Down
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.15")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.11.0")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.12.0")
addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.3.1")
Expand All @@ -9,7 +9,7 @@ addSbtPlugin("com.typesafe" % "sbt-mima-plugin"
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.15.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.15")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.3.8")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0")
Expand Down

0 comments on commit b2b68de

Please sign in to comment.