Let's say that I have a Monoid trait as below:
trait Monoid[A] {
def combine(a1: A, a2: A): A
def identity: A
}
Now if I want to write an optionMonoid for this, I could write it like this:
val optionMonoid1 = new Monoid[Option[A]] {
def combine(a1: Option[A], a2: Option[A2]) a1 orElse a2
def identity = None
}
This given the fact that I do not know anything about the inner type in the Option. But what if I want to have the combine operator in such a way that I want to really combine the inner types in the Option?
--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.