doobie.util.package.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of doobie-core-cats_2.11 Show documentation
Show all versions of doobie-core-cats_2.11 Show documentation
Pure functional JDBC layer for Scala.
The newest version!
package doobie
import cats._, cats.data._, cats.implicits._
/**
* Collection of modules for typeclasses and other helpful bits.
*/
package object util {
private[util] implicit class IdOps[A](a: A) {
def <|[B](f: A => B): A = { f(a); a }
}
private[util] implicit class MoreFoldableOps[F[_], A: Eq](fa: F[A])(implicit f: Foldable[F]) {
def element(a: A): Boolean =
f.exists(fa)(_ === a)
}
private[util] implicit class NelOps[A](as: NonEmptyList[A]) {
def list: List[A] = as.head :: as.tail
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy