All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tofu.logging.LoggingRepresentableKInstances.scala Maven / Gradle / Ivy

There is a newer version: 0.13.6
Show newest version
package tofu.logging

import cats.~>
import tofu.higherKind.{RepresentableK, RepK}
import tofu.logging.Logging.Level

trait LoggingRepresentableKInstances {

  // TODO: use higherKind.derived macro when it is ready
  given loggingRepresentable: RepresentableK[Logging] = new RepresentableK[Logging] {
    def tabulate[F[_]](hom: RepK[Logging, _] ~> F): Logging[F] = new Logging[F] {
      def write(level: Level, message: String, values: LoggedValue*): F[Unit] =
        hom(RepK[Logging](_.write(level, message, values: _*)))
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy