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.
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 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
An associative binary operation, circumscribed by type and the semigroup laws. Unlike scalaz.Monoid, there is not necessarily a zero.
http://mathworld.wolfram.com/Semigroup.html
scalaz.syntax.SemigroupOps
scalaz.Semigroup.SemigroupLaw