Skip to content

Commit

Permalink
Streamline macro naming
Browse files Browse the repository at this point in the history
  • Loading branch information
RustedBones committed May 31, 2024
1 parent ae5bf77 commit 9bdfe1e
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions cats/src/main/scala-2/magnolify/cats/CatsMacros.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,77 +24,77 @@ import scala.reflect.macros.*

private object CatsMacros {

@nowarn("msg=parameter lp in method autoDerivationShow is never used")
def autoDerivationShow[T: c.WeakTypeTag](c: whitebox.Context)(lp: c.Tree): c.Tree = {
@nowarn("msg=parameter lp in method autoDerivationShowMacro is never used")
def autoDerivationShowMacro[T: c.WeakTypeTag](c: whitebox.Context)(lp: c.Tree): c.Tree = {
import c.universe.*
val wtt = weakTypeTag[T]
q"""_root_.magnolify.cats.ShowDerivation.gen[$wtt]"""
}

@nowarn("msg=parameter lp in method autoDerivationEq is never used")
def autoDerivationEq[T: c.WeakTypeTag](c: whitebox.Context)(lp: c.Tree): c.Tree = {
@nowarn("msg=parameter lp in method autoDerivationEqMacro is never used")
def autoDerivationEqMacro[T: c.WeakTypeTag](c: whitebox.Context)(lp: c.Tree): c.Tree = {
import c.universe.*
val wtt = weakTypeTag[T]
q"""_root_.magnolify.cats.EqDerivation.gen[$wtt]"""
}

@nowarn("msg=parameter lp in method autoDerivationHash is never used")
def autoDerivationHash[T: c.WeakTypeTag](c: whitebox.Context)(lp: c.Tree): c.Tree = {
@nowarn("msg=parameter lp in method autoDerivationHashMacro is never used")
def autoDerivationHashMacro[T: c.WeakTypeTag](c: whitebox.Context)(lp: c.Tree): c.Tree = {
import c.universe.*
val wtt = weakTypeTag[T]
q"""_root_.magnolify.cats.HashDerivation.gen[$wtt]"""
}

@nowarn("msg=parameter lp in method autoDerivationSemigroup is never used")
def autoDerivationSemigroup[T: c.WeakTypeTag](c: whitebox.Context)(lp: c.Tree): c.Tree = {
@nowarn("msg=parameter lp in method autoDerivationSemigroupMacro is never used")
def autoDerivationSemigroupMacro[T: c.WeakTypeTag](c: whitebox.Context)(lp: c.Tree): c.Tree = {
import c.universe.*
val wtt = weakTypeTag[T]
q"""_root_.magnolify.cats.SemigroupDerivation.gen[$wtt]"""
}

@nowarn("msg=parameter lp in method autoDerivationMonoid is never used")
def autoDerivationMonoid[T: c.WeakTypeTag](c: whitebox.Context)(lp: c.Tree): c.Tree = {
@nowarn("msg=parameter lp in method autoDerivationMonoidMacro is never used")
def autoDerivationMonoidMacro[T: c.WeakTypeTag](c: whitebox.Context)(lp: c.Tree): c.Tree = {
import c.universe.*
val wtt = weakTypeTag[T]
q"""_root_.magnolify.cats.MonoidDerivation.gen[$wtt]"""
}

@nowarn("msg=parameter lp in method autoDerivationCommutativeSemigroup is never used")
def autoDerivationCommutativeSemigroup[T: c.WeakTypeTag](
@nowarn("msg=parameter lp in method autoDerivationCommutativeSemigroupMacro is never used")
def autoDerivationCommutativeSemigroupMacro[T: c.WeakTypeTag](
c: whitebox.Context
)(lp: c.Tree): c.Tree = {
import c.universe.*
val wtt = weakTypeTag[T]
q"""_root_.magnolify.cats.CommutativeSemigroupDerivation.gen[$wtt]"""
}

@nowarn("msg=parameter lp in method autoDerivationCommutativeMonoid is never used")
def autoDerivationCommutativeMonoid[T: c.WeakTypeTag](
@nowarn("msg=parameter lp in method autoDerivationCommutativeMonoidMacro is never used")
def autoDerivationCommutativeMonoidMacro[T: c.WeakTypeTag](
c: whitebox.Context
)(lp: c.Tree): c.Tree = {
import c.universe.*
val wtt = weakTypeTag[T]
q"""_root_.magnolify.cats.CommutativeMonoidDerivation.gen[$wtt]"""
}

@nowarn("msg=parameter lp in method autoDerivationGroup is never used")
def autoDerivationGroup[T: c.WeakTypeTag](c: whitebox.Context)(lp: c.Tree): c.Tree = {
@nowarn("msg=parameter lp in method autoDerivationGroupMacro is never used")
def autoDerivationGroupMacro[T: c.WeakTypeTag](c: whitebox.Context)(lp: c.Tree): c.Tree = {
import c.universe.*
val wtt = weakTypeTag[T]
q"""_root_.magnolify.cats.GroupDerivation.gen[$wtt]"""
}

@nowarn("msg=parameter lp in method autoDerivationCommutativeGroup is never used")
def autoDerivationCommutativeGroup[T: c.WeakTypeTag](
@nowarn("msg=parameter lp in method autoDerivationCommutativeGroupMacro is never used")
def autoDerivationCommutativeGroupMacro[T: c.WeakTypeTag](
c: whitebox.Context
)(lp: c.Tree): c.Tree = {
import c.universe.*
val wtt = weakTypeTag[T]
q"""_root_.magnolify.cats.CommutativeGroupDerivation.gen[$wtt]"""
}

@nowarn("msg=parameter lp in method autoDerivationBand is never used")
def autoDerivationBand[T: c.WeakTypeTag](c: whitebox.Context)(lp: c.Tree): c.Tree = {
@nowarn("msg=parameter lp in method autoDerivationBandMacro is never used")
def autoDerivationBandMacro[T: c.WeakTypeTag](c: whitebox.Context)(lp: c.Tree): c.Tree = {
import c.universe.*
val wtt = weakTypeTag[T]
q"""_root_.magnolify.cats.BandDerivation.gen[$wtt]"""
Expand All @@ -110,51 +110,51 @@ trait AutoDerivation extends LowPriority0Implicits

trait LowPriority0Implicits extends LowPriority1Implicits {
implicit def autoDerivationShow[T](implicit lp: shapeless.LowPriority): Show[T] =
macro CatsMacros.autoDerivationShow[T]
macro CatsMacros.autoDerivationShowMacro[T]
// CommutativeGroup <: Group | CommutativeMonoid
implicit def autoDerivationCommutativeGroup[T](implicit
lp: shapeless.LowPriority
): CommutativeGroup[T] =
macro CatsMacros.autoDerivationCommutativeGroup[T]
macro CatsMacros.autoDerivationCommutativeGroupMacro[T]
// Hash <: Eq
implicit def autoDerivationHash[T](implicit lp: shapeless.LowPriority): Hash[T] =
macro CatsMacros.autoDerivationHash[T]
macro CatsMacros.autoDerivationHashMacro[T]
}

trait LowPriority1Implicits extends LowPriority2Implicits {
implicit def autoDerivationEq[T](implicit lp: shapeless.LowPriority): Eq[T] =
macro CatsMacros.autoDerivationEq[T]
macro CatsMacros.autoDerivationEqMacro[T]
// Group <: Monoid
implicit def autoDerivationGroup[T](implicit lp: shapeless.LowPriority): Group[T] =
macro CatsMacros.autoDerivationGroup[T]
macro CatsMacros.autoDerivationGroupMacro[T]
}

trait LowPriority2Implicits extends LowPriority3Implicits {
// CommutativeMonoid <: Monoid | CommutativeSemigroup
implicit def autoDerivationCommutativeMonoid[T](implicit
lp: shapeless.LowPriority
): CommutativeMonoid[T] =
macro CatsMacros.autoDerivationCommutativeMonoid[T]
macro CatsMacros.autoDerivationCommutativeMonoidMacro[T]
}

trait LowPriority3Implicits extends LowPriority4Implicits {
// CommutativeSemigroup <: Semigroup
implicit def autoDerivationCommutativeSemigroup[T](implicit
lp: shapeless.LowPriority
): CommutativeSemigroup[T] =
macro CatsMacros.autoDerivationCommutativeSemigroup[T]
macro CatsMacros.autoDerivationCommutativeSemigroupMacro[T]
// Monoid <: Semigroup
implicit def autoDerivationMonoid[T](implicit lp: shapeless.LowPriority): Monoid[T] =
macro CatsMacros.autoDerivationMonoid[T]
macro CatsMacros.autoDerivationMonoidMacro[T]
}

trait LowPriority4Implicits extends LowPriority5Implicits {
// Band <: Semigroup
implicit def autoDerivationBand[T](implicit lp: shapeless.LowPriority): Band[T] =
macro CatsMacros.autoDerivationBand[T]
macro CatsMacros.autoDerivationBandMacro[T]
}

trait LowPriority5Implicits {
implicit def autoDerivationSemigroup[T](implicit lp: shapeless.LowPriority): Semigroup[T] =
macro CatsMacros.autoDerivationSemigroup[T]
macro CatsMacros.autoDerivationSemigroupMacro[T]
}

0 comments on commit 9bdfe1e

Please sign in to comment.