Monoid instances must satisfy scalaz.Semigroup.SemigroupLaw and 2 additional laws:
Monoid instances must satisfy scalaz.Semigroup.SemigroupLaw and 2 additional laws:
forall a. append(zero, a) == a
forall a. append(a, zero) == a
A semigroup in type F must satisfy two laws:
A semigroup in type F must satisfy two laws:
∀ a, b in F, append(a, b)
is also in F
. This is enforced by the type system.∀ a, b, c
in F
, the equation append(append(a, b), c) = append(a, append(b , c))
holds.
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
.
A monoidal applicative functor, that implements point
and ap
with the operations zero
and append
respectively.
A monoidal applicative functor, that implements point
and ap
with the operations zero
and append
respectively. Note that
the type parameter α
in Applicative[({type λ[α]=F})#λ]
is
discarded; it is a phantom type. As such, the functor cannot
support scalaz.Bind.
An scalaz.Apply, that implements ap
with append
.
An scalaz.Apply, that implements ap
with append
. Note
that the type parameter α
in Apply[({type λ[α]=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.
category.monoid
= this
The composition of PlusEmpty F
and G
, [x]F[G[x]]
, is a PlusEmpty
The composition of PlusEmpty F
and G
, [x]F[G[x]]
, is a PlusEmpty
The composition of Plus F
and G
, [x]F[G[x]]
, is a Plus
The composition of Plus F
and G
, [x]F[G[x]]
, is a Plus
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.
compose.semigroup
= this
true, if equal(f1, f2)
is known to be equivalent to f1 == f2
Whether a
== zero
.
Whether a
== zero
.
For n = 0
, zero
For n = 1
, append(zero, value)
For n = 2
, append(append(zero, value), value)
For n = 0
, zero
For n = 1
, append(zero, value)
For n = 2
, append(append(zero, value), value)
The product of PlusEmpty F
and G
, [x](F[x], G[x]])
, is a PlusEmpty
The product of PlusEmpty F
and G
, [x](F[x], G[x]])
, is a PlusEmpty
The product of Plus F
and G
, [x](F[x], G[x]])
, is a Plus
The product of Plus F
and G
, [x](F[x], G[x]])
, is a Plus
Order.fromScalaOrdering(toScalaOrdering).order(x, y)
this.order(x, y)
The identity element for append
.
The identity element for append
.