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

spire.algebra.Semigroup.scala Maven / Gradle / Ivy

The newest version!
package spire.algebra

import spire.macrosk.Ops
import language.experimental.macros

trait Semigroup[A] {
  def op(x:A, y:A): A
}

object Semigroup {
  @inline final def apply[A](implicit s: Semigroup[A]) = s
}

final class SemigroupOps[A](lhs:A)(implicit ev:Semigroup[A]) {
  def |+|(rhs:A) = macro Ops.binop[A, A]
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy