Skip to content

Commit

Permalink
Merge branch 'series/2.x' into update/sbt-scalajs-1.18.1
Browse files Browse the repository at this point in the history
  • Loading branch information
guizmaii authored Jan 17, 2025
2 parents a2546d2 + 86ece71 commit 6edf1a6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 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.8.4"
version = "3.8.5"
maxColumn = 120
align.preset = most
continuationIndent.defnSite = 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ object IdentityBothSpec extends ZIOBaseSpec {
test("list")(checkAllLaws(IdentityBothLaws)(GenF.list, Gen.int)),
test("option")(checkAllLaws(IdentityBothLaws)(GenF.option, Gen.int)),
test("optional")(checkAllLaws(IdentityBothLaws)(optionalGenF, Gen.int)),
test("try")(checkAllLaws(IdentityBothLaws)(GenFs.tryScala, Gen.int))
test("try")(checkAllLaws(IdentityBothLaws)(GenFs.tryScala, Gen.int)),
test("vector")(checkAllLaws(IdentityBothLaws)(GenF.vector, Gen.int))
)
)
}
7 changes: 4 additions & 3 deletions core/shared/src/main/scala/zio/prelude/AssociativeBoth.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1389,10 +1389,11 @@ object AssociativeBoth extends AssociativeBothLowPriority {
}

/**
* The `AssociativeBoth` instance for `Vector`.
* The `IdentityBoth` (and `AssociativeBoth`) instance for `Vector`.
*/
implicit val VectorAssociativeBoth: AssociativeBoth[Vector] =
new AssociativeBoth[Vector] {
implicit val VectorIdentityBoth: IdentityBoth[Vector] =
new IdentityBoth[Vector] {
def any: Vector[Any] = Vector(())
def both[A, B](fa: => Vector[A], fb: => Vector[B]): Vector[(A, B)] = fa.flatMap(a => fb.map(b => (a, b)))
}

Expand Down
14 changes: 11 additions & 3 deletions docs/functional-abstractions/abstraction-diagrams.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,11 @@ classDiagram
AssociativeBoth~F<_>~ <|-- CommutativeBoth~F<_>~
AssociativeBoth~F<_>~ <|-- IdentityBoth~F<_>~
class AssociativeBoth~F<_>~{
Exit[E, +*]
Fiber[E, +*]
STM[R, E, +*]
NonEmptyChunk[+*]
ZSink[R, E, I, L, +*]
ZStream[R, E, +*]
() both[A,B](=> F[A], => F[B]): F[(A,B)]
}
Expand All @@ -175,18 +178,23 @@ classDiagram
ZLayer[R, E, +*]
ZManaged[R, E, +*]
Failure[ZManaged[R, E, +*]]
ZSink[R, E, I, I, +*]
ZSink[R, E, I, L, +*]
ZStream[R, E, +*]
}
class IdentityBoth~F<_>~{
Chunk[+*]
Config[+*]
Either[L, +*]
Failure[Either[+*, R]]
Option[+*]
Optional[+*]
Future[+*]
Id[+*]
List[+*]
STM[R, E, +*]
Try[+*]
Vector[+*]
() any: F[Any]
}
```
Expand Down
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "2.0.6")
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "2.0.7")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.14.0")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.13.1")
addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0")
Expand All @@ -12,7 +12,7 @@ addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject"
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.18.1")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.6")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.6.2")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.3")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.4")
addSbtPlugin("pl.project13.scala" % "sbt-jcstress" % "0.2.0")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7")
addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.4.0-alpha.30")

0 comments on commit 6edf1a6

Please sign in to comment.