Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Excerpted from https://github.com/scalaz/scalaz for instructional purposes
trait Monoid[F] extends Semigroup[F] {
...
trait MonoidLaw extends SemigroupLaw {
def leftIdentity(a: F)(implicit F: Equal[F]) =
F.equal(a, append(zero, a))
def rightIdentity(a: F)(implicit F: Equal[F]) =
F.equal(a, append(a, zero))
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment