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

doobie.util.package.scala Maven / Gradle / Ivy

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