Skip to content

Commit

Permalink
go
Browse files Browse the repository at this point in the history
  • Loading branch information
jatcwang committed Oct 29, 2024
1 parent 8591ab4 commit 5e46fbe
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions modules/core/src/main/scala-3/doobie/util/MkReadPlatform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import doobie.util.shapeless.OrElse
trait MkReadPlatform:

// Derivation for product types (i.e. case class)
given derived[P <: Product, A](
using
implicit def derived[P <: Product, A](
implicit
m: Mirror.ProductOf[P],
i: A =:= m.MirroredElemTypes,
r: Read[A] `OrElse` Derived[MkRead[A]]
Expand All @@ -21,8 +21,8 @@ trait MkReadPlatform:
}

// Derivation base case for tuple (1-element)
given productBase[H](
using H: Read[H] `OrElse` Derived[MkRead[H]]
implicit def productBase[H](
implicit H: Read[H] `OrElse` Derived[MkRead[H]]
): Derived[MkRead[H *: EmptyTuple]] = {
val headInstance = H.fold(identity, _.instance)
new Derived(
Expand All @@ -35,8 +35,8 @@ trait MkReadPlatform:
}

// Derivation inductive case for tuples
given product[H, T <: Tuple](
using
implicit def product[H, T <: Tuple](
implicit
H: Read[H] `OrElse` Derived[MkRead[H]],
T: Read[T] `OrElse` Derived[MkRead[T]]
): Derived[MkRead[H *: T]] = {
Expand Down
12 changes: 6 additions & 6 deletions modules/core/src/main/scala-3/doobie/util/MkWritePlatform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import doobie.util.shapeless.OrElse
trait MkWritePlatform:

// Derivation for product types (i.e. case class)
given derived[P <: Product, A](
using
implicit def derived[P <: Product, A](
implicit
m: Mirror.ProductOf[P],
i: m.MirroredElemTypes =:= A,
w: Derived[MkWrite[A]]
Expand All @@ -22,8 +22,8 @@ trait MkWritePlatform:
)

// Derivation base case for tuple (1-element)
given productBase[H](
using H: Write[H] `OrElse` Derived[MkWrite[H]]
implicit def productBase[H](
implicit H: Write[H] `OrElse` Derived[MkWrite[H]]
): Derived[MkWrite[H *: EmptyTuple]] = {
val headInstance = H.fold(identity, _.instance)
new Derived(
Expand All @@ -35,8 +35,8 @@ trait MkWritePlatform:
}

// Derivation inductive case for tuples
given product[H, T <: Tuple](
using
implicit def product[H, T <: Tuple](
implicit
H: Write[H] `OrElse` Derived[MkWrite[H]],
T: Write[H] `OrElse` Derived[MkWrite[H]]
): Derived[MkWrite[H *: T]] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
package doobie.util

import cats.data.NonEmptyList
import doobie.implicits.{*, given}
import doobie.implicits.*
import cats.effect.IO
import doobie.{Transactor, Fragment, Fragments}

Expand Down

0 comments on commit 5e46fbe

Please sign in to comment.