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

de.lhns.common.skunk.ConnectionF.scala Maven / Gradle / Ivy

There is a newer version: 0.5.0
Show newest version
package de.lhns.common.skunk

import cats.arrow.FunctionK
import cats.data.Kleisli
import skunk.Session

type ConnectionF[F[_], A] = Kleisli[F, Session[F], A]

def ConnectionF[F[_], A](f: Session[F] => F[A]): ConnectionF[F, A] = Kleisli(f)

extension [F[_]](session: Session[F]) {
  def trans: FunctionK[ConnectionF[F, _], F] = new FunctionK[ConnectionF[F, _], F] {
    override def apply[A](fa: ConnectionF[F, A]): F[A] =
      fa(session)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy