tofu.control.Consume.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tofu-kernel_3 Show documentation
Show all versions of tofu-kernel_3 Show documentation
Opinionated set of tools for functional programming in Scala
package tofu.control
import cats.ContravariantMonoidal
import tofu.internal.EffectComp
trait Consume[F[_]] extends Partial[F] with ContravariantMonoidal[F] with ContravariantFilter[F] {
override def product[A, B](fa: F[A], fb: F[B]): F[(A, B)] =
combineK(contramap(fa)(_._1), contramap(fb)(_._2))
override def unit: F[Unit] = empty[Unit]
override def trivial[A]: F[A] = empty[A]
override def contramapFilter[A, B](fa: F[A])(f: B => Option[A]): F[B] = contramap(optional(fa))(f)
}
object Consume extends EffectComp[Consume]
© 2015 - 2025 Weber Informatics LLC | Privacy Policy