Skip to content

Commit

Permalink
add explicit names for givens for easier binary compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jatcwang committed Dec 19, 2023
1 parent a412d2b commit a89b100
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions modules/core/src/main/scala-3/util/ReadPlatform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import doobie.util.shapeless.OrElse
trait ReadPlatform:

// Trivial Read for EmptyTuple
given MkRead[EmptyTuple] =
given readEmpty: MkRead[EmptyTuple] =
new MkRead[EmptyTuple](Nil, (_, _) => EmptyTuple)

// Read for head and tail.
given [H, T <: Tuple](
given readTuple[H, T <: Tuple](
using H: Read[H] OrElse MkRead[H],
T: => MkRead[T]
): MkRead[H *: T] = {
Expand All @@ -27,7 +27,7 @@ trait ReadPlatform:
}

// Generic Read for products.
given [P <: Product, A](
given derived[P <: Product, A](
using m: Mirror.ProductOf[P],
i: A =:= m.MirroredElemTypes,
w: MkRead[A]
Expand Down Expand Up @@ -71,7 +71,7 @@ trait ReadPlatform:
}

// Generic Read for option of products.
given [P <: Product, A](
given readOptionProduct[P <: Product, A](
using m: Mirror.ProductOf[P],
i: A =:= m.MirroredElemTypes,
w: MkRead[Option[A]]
Expand Down
6 changes: 3 additions & 3 deletions modules/core/src/main/scala-3/util/WritePlatform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import doobie.util.shapeless.OrElse
trait WritePlatform:

// Trivial write for empty tuple.
given MkWrite[EmptyTuple] =
given writeEmpty: MkWrite[EmptyTuple] =
new MkWrite(Nil, _ => Nil, (_, _, _) => (),(_, _, _) => ())

// Inductive write for writable head and tail.
given [H, T <: Tuple](
given writeTuple[H, T <: Tuple](
using H: Write[H] OrElse MkWrite[H],
T: => MkWrite[T]
): MkWrite[H *: T] = {
Expand Down Expand Up @@ -82,7 +82,7 @@ trait WritePlatform:
)

// Generic write for options of products.
given [P <: Product, A](
given writeOptionProduct[P <: Product, A](
using m: Mirror.ProductOf[P],
i: m.MirroredElemTypes =:= A,
w: MkWrite[Option[A]]
Expand Down

0 comments on commit a89b100

Please sign in to comment.