tofu.syntax.monoid.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.syntax
import cats.syntax.SemigroupSyntax
import cats.{Monoid, Semigroup}
object monoid extends SemigroupSyntax {
def empty[A](implicit A: Monoid[A]): A = A.empty
implicit final class TofuSemigroupOps[A](private val lhs: A) extends AnyVal {
def |+|(rhs: A)(implicit A: Semigroup[A]): A = A.combine(lhs, rhs)
def combine(rhs: A)(implicit A: Semigroup[A]): A = A.combine(lhs, rhs)
def combineN(rhs: Int)(implicit A: Semigroup[A]): A = A.combineN(lhs, rhs)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy