Open johnynek opened 9 years ago
See:
https://github.com/twitter/algebird/blob/develop/algebird-core/src/main/scala/com/twitter/algebird/AdjoinedUnitRing.scala
Like you can always use Option[T] to lift a Semigroup to a Monoid, you can always adjoin a unit element to any Rng to create a Ring. This is useful to create a Ring[Map[K, V]] where there is a Ring[V], without this, there is no unit map.
Option[T]
Ring[Map[K, V]]
Ring[V]
See:
https://github.com/twitter/algebird/blob/develop/algebird-core/src/main/scala/com/twitter/algebird/AdjoinedUnitRing.scala
Like you can always use
Option[T]
to lift a Semigroup to a Monoid, you can always adjoin a unit element to any Rng to create a Ring. This is useful to create aRing[Map[K, V]]
where there is aRing[V]
, without this, there is no unit map.