Provides an identity element (zero
) to the binary append
operation in scalaz.Semigroup, subject to the monoid laws.
Example instances:
Monoid[Int]
:zero
andappend
are0
andInt#+
respectivelyMonoid[List[A]]
:zero
andappend
areNil
andList#++
respectively
References:
- See also
- Companion
- object
Type members
Classlikes
Monoid instances must satisfy scalaz.Semigroup.SemigroupLaw and 2 additional laws:
Monoid instances must satisfy scalaz.Semigroup.SemigroupLaw and 2 additional laws:
- '''left identity''':
forall a. append(zero, a) == a
- '''right identity''' :
forall a. append(a, zero) == 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 inF
. This is enforced by the type system. - '''associativity''':
∀ a, b, c
inF
, the equationappend(append(a, b), c) = append(a, append(b , c))
holds.
- Inherited from
- Semigroup
Value members
Abstract methods
Concrete methods
A monoidal applicative functor, that implements point
and ap
with the operations zero
and append
respectively. Note that
the type parameter α
in Applicative[λ[α => F]]
is
discarded; it is a phantom type. As such, the functor cannot
support scalaz.Bind.
A monoidal applicative functor, that implements point
and ap
with the operations zero
and append
respectively. Note that
the type parameter α
in Applicative[λ[α => F]]
is
discarded; it is a phantom type. As such, the functor cannot
support scalaz.Bind.
Every Monoid
gives rise to a scalaz.Category, for which
the type parameters are phantoms.
Every Monoid
gives rise to a scalaz.Category, for which
the type parameters are phantoms.
- Note
category.monoid
=this
Inherited methods
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
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
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
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 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.