forked from tofu-tf/tofu
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
syntax and representableK macro adopt.
- Loading branch information
Showing
30 changed files
with
194 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
modules/kernel/higherKind/src/main/scala-2/tofu/higherKind/Defs.scala
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,6 @@ package object higherKind { | |
type Pre[F[_], A] = Pre.T[F, A] | ||
|
||
type UnitK[A] = Unit | ||
|
||
type HKAny[_] = Any | ||
} |
7 changes: 7 additions & 0 deletions
7
modules/logging/structured/src/main/scala-2/tofu/logging/LoggingMidMacroInstances.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package tofu.logging | ||
|
||
import tofu.higherKind.derived.HigherKindedMacros | ||
|
||
trait LoggingMidMacroInstances { | ||
def instance[U[_[_]]]: U[LoggingMid] = macro HigherKindedMacros.factorizeThis[U] | ||
} |
11 changes: 11 additions & 0 deletions
11
...les/logging/structured/src/main/scala-2/tofu/logging/LoggingRepresentableKInstances.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package tofu.logging | ||
|
||
import tofu.higherKind.RepresentableK | ||
import tofu.higherKind | ||
|
||
import scala.annotation.nowarn | ||
|
||
trait LoggingRepresentableKInstances { | ||
@nowarn("cat=w-flag-self-implicit") | ||
implicit val loggingRepresentable: RepresentableK[Logging] = higherKind.derived.genRepresentableK[Logging] | ||
} |
14 changes: 14 additions & 0 deletions
14
...ging/structured/src/main/scala-2/tofu/logging/ServiceLoggingRepresentableKInstances.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package tofu | ||
package logging | ||
|
||
import tofu.higherKind.RepresentableK | ||
|
||
trait ServiceLoggingRepresentableKInstances { | ||
|
||
private[this] val representableAny: RepresentableK[({ type L[x[_]] = ServiceLogging[x, Any] })#L] = | ||
higherKind.derived.genRepresentableK[({ type L[x[_]] = ServiceLogging[x, Any] })#L] | ||
|
||
final implicit def serviceLoggingRepresentable[Svc]: RepresentableK[({ type L[x[_]] = ServiceLogging[x, Svc] })#L] = | ||
representableAny.asInstanceOf[RepresentableK[({ type L[x[_]] = ServiceLogging[x, Svc] })#L]] | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
...ofu/logging/impl/UniversalEmbedLogs.scala → ...ofu/logging/impl/UniversalEmbedLogs.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
package tofu.logging.impl | ||
|
||
import cats.{FlatMap, Id} | ||
import tofu.lift.Lift | ||
import tofu.logging.{Logging, Logs} | ||
|
18 changes: 18 additions & 0 deletions
18
...gging/structured/src/main/scala-2/tofu/logging/internal/LogsRepresentableKInstances.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package tofu.logging.internal | ||
|
||
import tofu.higherKind | ||
import tofu.higherKind.RepresentableK | ||
import tofu.logging.Logs | ||
import cats.Id | ||
|
||
trait LogsRepresentableKInstances { | ||
private[this] val logs1RepresentableAny: RepresentableK[({ type L[x[_]] = Logs[x, Any] })#L] = | ||
higherKind.derived.genRepresentableK[({ type L[x[_]] = Logs[x, Any] })#L] | ||
|
||
implicit def logs1Representable[Y[_]]: RepresentableK[({ type L[x[_]] = Logs[x, Y] })#L] = | ||
logs1RepresentableAny.asInstanceOf[RepresentableK[({ type L[x[_]] = Logs[x, Y] })#L]] | ||
|
||
implicit val logs2UniversalRepresentable: RepresentableK[({ type L[x[_]] = Logs[Id, x] })#L] = | ||
higherKind.derived.genRepresentableK[({ type L[x[_]] = Logs[Id, x] })#L] | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
modules/logging/structured/src/main/scala-3/tofu/logging/LoggingMidMacroInstances.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package tofu.logging | ||
|
||
trait LoggingMidMacroInstances { | ||
// TODO | ||
} |
5 changes: 5 additions & 0 deletions
5
...les/logging/structured/src/main/scala-3/tofu/logging/LoggingRepresentableKInstances.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package tofu.logging | ||
|
||
trait LoggingRepresentableKInstances { | ||
// TODO | ||
} |
5 changes: 5 additions & 0 deletions
5
...ging/structured/src/main/scala-3/tofu/logging/ServiceLoggingRepresentableKInstances.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package tofu.logging | ||
|
||
trait ServiceLoggingRepresentableKInstances { | ||
// TODO | ||
} |
11 changes: 11 additions & 0 deletions
11
modules/logging/structured/src/main/scala-3/tofu/logging/impl/UniversalEmbedLogs.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package tofu.logging.impl | ||
|
||
import cats.{FlatMap, Id} | ||
import tofu.lift.Lift | ||
import tofu.logging.{Logging, Logs} | ||
|
||
import scala.reflect.ClassTag | ||
|
||
class UniversalEmbedLogs[I[_], F[_]: FlatMap](underlying: Logs[I, F])(implicit lift: Lift[I, F]) extends Logs.Universal[F] { | ||
// TODO | ||
} |
5 changes: 5 additions & 0 deletions
5
...gging/structured/src/main/scala-3/tofu/logging/internal/LogsRepresentableKInstances.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package tofu.logging.internal | ||
|
||
trait LogsRepresentableKInstances { | ||
// TODO | ||
} |
1 change: 1 addition & 0 deletions
1
...es/logging/structured/src/main/scala-3/tofu/logging/location/LocationMacroInstances.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
package tofu.logging.location | ||
|
||
trait LocationMacroInstances: | ||
// TODO | ||
implicit def location: Location = ??? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.