Band

trait Band[F] extends Semigroup[F]

scalaz.Semigroup which is also idempotent, i.e. appending a value with itself results in the same value.

See also
Companion
object
trait Semigroup[F]
class Object
trait Matchable
class Any
Band[F]

Type members

Classlikes

trait BandLaw extends SemigroupLaw

Band instances must satisfy scalaz.Semigroup.SemigroupLaw and 1 additional law:

Band instances must satisfy scalaz.Semigroup.SemigroupLaw and 1 additional law:

  • '''idempotency''': forall a. append(a, a) == a

Inherited classlikes

A semigroup in type F must satisfy two laws:

A semigroup in type F must satisfy two laws:

  • '''closure''': ∀ a, b in F, append(a, b) is also in F. This is enforced by the type system.
  • '''associativity''': ∀ a, b, c in F, the equation append(append(a, b), c) = append(a, append(b , c)) holds.
Inherited from
Semigroup

Value members

Concrete methods

override
def multiply1(value: F, n: Int): F

The default definition exploits idempotency to optimise to O(1)

The default definition exploits idempotency to optimise to O(1)

Definition Classes

Inherited methods

def append(f1: F, f2: => F): F

The binary operation to combine f1 and f2.

The binary operation to combine f1 and f2.

Implementations should not evaluate the by-name parameter f2 if result can be determined by f1.

Inherited from
Semigroup
final
def apply: Apply[[α] =>> F]

An scalaz.Apply, that implements ap with append. Note that the type parameter α in Apply[λ[α => F]] is discarded; it is a phantom type. As such, the functor cannot support scalaz.Bind.

An scalaz.Apply, that implements ap with append. Note that the type parameter α in Apply[λ[α => F]] is discarded; it is a phantom type. As such, the functor cannot support scalaz.Bind.

Inherited from
Semigroup
final
def compose: Compose[[α, β] =>> F]

Every Semigroup gives rise to a scalaz.Compose, for which the type parameters are phantoms.

Every Semigroup gives rise to a scalaz.Compose, for which the type parameters are phantoms.

Note

compose.semigroup = this

Inherited from
Semigroup
def unfoldlSumOpt[S](seed: S)(f: S => Maybe[(S, F)]): Maybe[F]

Unfold seed to the left and sum using append. Semigroups with right absorbing elements may override this method to not unfold more than is necessary to determine the result.

Unfold seed to the left and sum using append. Semigroups with right absorbing elements may override this method to not unfold more than is necessary to determine the result.

Inherited from
Semigroup
def unfoldrSumOpt[S](seed: S)(f: S => Maybe[(F, S)]): Maybe[F]

Unfold seed to the right and sum using append. Semigroups with left absorbing elements may override this method to not unfold more than is necessary to determine the result.

Unfold seed to the right and sum using append. Semigroups with left absorbing elements may override this method to not unfold more than is necessary to determine the result.

Inherited from
Semigroup

Concrete fields

Inherited fields