September 2018
Intermediate to advanced
398 pages
9h 43m
English
We can see why this empty function is called the identity element; if you combine any object with the identity element, it returns the same object, as follows:
(3 |+| Monoid[Int].empty) == 3 ("Hello identity" |+| Monoid[String].empty) == "Hello identity" (Option(3) |+| Monoid[Option[Int]].empty) == Option(3)
This property is formally defined by the identity laws, as follows:
Read now
Unlock full access