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

tofu.syntax.monoid.scala Maven / Gradle / Ivy

There is a newer version: 0.9.2
Show newest version
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 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 - 2024 Weber Informatics LLC | Privacy Policy